Hi. I'm trying to insert my Facebook Pixel in the head of a survey page. Here is the code:
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'
connect.facebook.net/en_US/fbevents.js
');
fbq('init', 'ACCOUNT NUMBER');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="
www.facebook.com/tr?id=ACCOUNT
NUMBER&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
I insert this, as with non-LimeSurvey pages, just before the </head> tag.
However, this throws a javascript error every time: "Uncaught SyntaxError: Unexpected token <"
But, from the source code, it looks like LimeSurvey is trying to render the "if" function in the code rather than process it (see attached)
I did try inserting the script via template.js as well - same error.
Any ideas?