josh_elkin
(josh_elkin)
February 14, 2016, 5:33pm
1
Hi, I am getting an error on the following portion of FB’s pixel script when trying to place FB pixel in header - I remember reading somewhere on these forums that Webflow doesn’t handle these noscripts well - what would be the equivalent code in a webflow-friendly format? Thanks!
noscript
/noscript
PixelGeek
(Nelson)
February 14, 2016, 7:23pm
2
josh_elkin
(josh_elkin)
February 14, 2016, 7:44pm
3
I am using the custom code area…
Remove new lines (enters) at the end of each line. I’m 100% sure that’s the case :)
josh_elkin
(josh_elkin)
February 16, 2016, 2:19am
5
That did not solve the issue
RickSupport
(Rick Breeuwer)
February 17, 2016, 12:03pm
7
I have the same problem! Hope someone knows what to do?
MaciejIVE
(Maciej)
February 17, 2016, 12:10pm
8
hi @josh_elkin
Try this:
<!-- 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', '982578691793703');
fbq('track', "PageView");
</script>
<script language="JavaScript">
<!--
document.writeln("<noscript><img height=\"1\" width=\"1\" alt=\"\" style=\"display:none\" src=\"https://www.facebook.com/tr?id=982578691793703&ev=PageView&noscript=1"" /></noscript>");
//-->
</script>
<!-- End Facebook Pixel Code -->
Epic bump! The writeln does NOT work – Although Webflow accepts it, Pixel warns me that the code isn’t active!
cyberdave
(Dave S.)
February 22, 2016, 5:14am
10
Hi @Dylan_Hunt , thanks for the post. At the moment, the noscript tag is not supported in the code editor. The best thing to do is to just leave it out completely.
Leaving the noscript tag in the custom code, and using document.writeln will work to save the code, but will have no effect on the page.
That code is just saying, "if there is no support for javascript in the browser, then display the link “https://www.facebook.com/tr?id=982578691793703&ev=PageView&noscript=1 ”
I hope this helps!
system
(system)
Closed
April 23, 2016, 2:15am
11
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.