Improving LimeSurvey Sharing in Social Media with Open Graph Data

Researchers and students conducting online surveys with LimeSurvey often share their survey link on social media like Facebook or Twitter. These platforms automatically render the link with a preview image, a headline and short description if the linked source provides the required information in form of the Open Graph protocol meta data. The delivered basic LimeSurvey templates/theme do not include the relevant code lines but can be extended easily.

Simply extend the basic template/theme, modify the head.twig file and add the following highlighted lines before the title tag. You still need to change the BASEURL and upload a preview image to the template folder.

<meta property="og:title" content="{{ }}" >
<meta property="og:description" content="{{ aSurveyInfo.description }}" >
<meta property="og:type" content="website" >
<meta property="og:image" content="BASEURL{{ aSurveyInfo.oTemplate.sTemplateurl }}files/FILENAME" >
<meta property="og:url" content="{{ aSurveyInfo.url }}" >