Problems installing Facebook Pixl

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Kaylen
Forum Members
Forum Members
Posts: 128
Joined: Mon May 01, 2006 5:24 pm

Problems installing Facebook Pixl

Post by Kaylen »

I have been trying to install Facebook Pixel but not succeeding and I need help please.

When I add it to the template right above the </head> part where they say to add it (first screenshot),
Where I add the code in the template
Where I add the code in the template
I get a syntax error when I try to save the template (second screenshot)
The syntax error I am getting
The syntax error I am getting

I don't know how to fix this and I have tried contacting FB but they are not responding, so I would appreciate it greatly if someone could lend assistance, thank you in advance!

I copy and paste the code directly form the facebook pixel install page...

This is it:
<!-- 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',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1503549823290444');
fbq('track', 'PageView');
</__script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=15035498 ... noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Problems installing Facebook Pixl

Post by Rolf »

You have to add {literal} {/literal} around the javascript code.

Or add in that code a space before and after the curly brackets.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Kaylen
Forum Members
Forum Members
Posts: 128
Joined: Mon May 01, 2006 5:24 pm

Re: Problems installing Facebook Pixl

Post by Kaylen »

Thank you, now I can save it indeed! Gonna try if it's working correctly now, thanks so much :)
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1921
Joined: Mon Jan 29, 2007 4:47 pm

Re: Problems installing Facebook Pixl

Post by Jo Morg »

The fact that the javascript code is visible means that there is an error somewhere else in your template. Make sure the code is being inserted right above the </head> tag as stated and that the tags are paired correctly.
Either of Rolf's suggestions work the same, so the error must be somewhere else.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “The Lounge”