Streaming live at 10am (PST)

Ability to use NOSCRIPT tag in custom code


#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
src="https://www.facebook.com/tr?id=982578691793703&ev=PageView&noscript=1"
/>
/noscript


#2

Try adding custom code using the custom code area or embed component:

http://help.webflow.com/site-settings/custom-code

http://help.webflow.com/faq/how-to-use-the-embed-widget-to-add-custom-code-to-a-webpage


#3

I am using the custom code area...


#4

Remove new lines (enters) at the end of each line. I'm 100% sure that's the case :)


#5

That did not solve the issue


#7

I have the same problem! Hope someone knows what to do?


#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 -->

#9

Epic bump! The writeln does NOT work -- Although Webflow accepts it, Pixel warns me that the code isn't active!


#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!


#11

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.