====== pageHead() ====== void **pageHead**(string //Content//) The ''pageHead()'' function writes content to the head ('''') of the HTML output. This can be used, for example, on the first page of the questionnaire [[https://developers.facebook.com/docs/sharing/webmasters#markup|Open Graph]] Markup can be deposited to control the preview in Facebook. * //Content//\\ The XML/HTML content to be added to the questionnaire page header. **Warning:** Faulty XML/HTML code can cause the questionnaire page to be displayed incorrectly or not at all. **Note:** If you want to add the same content to all pages of the questionnaire, you can also write it directly into the //HTML template// of the [[:en:create:layout|questionnaire layout]]. **Note:** Preferably, use the ''[[:en:create:functions:library]]'' function to load JavaScript libraries. ===== Customize Facebook Preview ===== If you want to define with which short text and image (thumbnail) the questionnaire is displayed in a Facebook post, you would place the following PHP code for this on the first page of the questionnaire: pageHead(' '); If this does not work, it can have several causes: * Facebook has already called the link once before and has the old version (without image) in the cache. * The questionnaire was not publically accessible when Facebook first pulled up the link. * The code is not on the first page of the questionnaire or another questionnaire is defined as default under **Compose Questionnaire**. * There is an error in the URL of the image. The easiest way to fix these problems is with a tool from Facebook, the [[https://developers.facebook.com/tools/debug/|Sharing Debugger]]. There you enter the link to the questionnaire and then click on "Troubleshooting". If an outdated version is displayed, you can tell Facebook to rescan the page by clicking "Rescan". A quick description of the data: * ''''\\ According to the specification, the questionnaire URL should be explicitly specified again. * ''''\\ The [title] to be displayed in the post. * ''''\\ The [URL] of the image to be displayed. * ''''\\ A description with max. 200 characters, which should be displayed in the posting. * ''''\\ The [type] of the offer (default is ''website'') is relevant if you want, for example, the display for videos or news articles ... but false information here can lead to blocking on Facebook. Possible types are described in the [[https://ogp.me/#types|The Open Graph protocol]]. * ''''\\ A Facebook App ID if you want to use Facebook Insights. You can get the ID in the developer area of Facebook.