Insert Pixel code into Blogspot - how to insert Facebook pixel code into a site web

Breaking News

Insert Pixel code into Blogspot - how to insert Facebook pixel code into a site web

Insert Pixel code into Blogspot,  source code, add, How to Add Google Analytics to Blogger 2014, Google Analytics (Software),  EDM, 310, Blogs, Embed, how to insert Facebook pixel code into a site web,

Insert Pixel code into Blogspot - how to insert Facebook pixel code into a site web

Insert Pixel code into Blogspot
Insert Pixel code into Blogspot - how to insert Facebook pixel code into a site web

My website is built on a Blogspot platform and recently I added a custom object Pixel code to facilitate Remarketing activities later. However,
when inserting the javascript embed code that Facebook provided, it encountered an error that it could not insert into Blogspot.


<! - 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', '297724064527547');
fbq ('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
  src="https://www.facebook.com/tr?id=297724064527547&ev=PageView&noscript=1"
/></noscript>
<! - End Facebook Pixel Code ->

Blogspot does not allow saving when saving. The reason is probably because there is a small difference between HTML and XML, I also found a topic asking about this issue on the Blogger Forum, but there was no satisfactory answer. So I brooded a little bit more and made a decision. Use the following code

&lt;!-- Facebook Pixel Code --&gt;
&lt;script&gt;
  !functionundefinedf,b,e,v,n,t,s)
  {ifundefinedf.fbq)return;n=f.fbq=functionundefined){n.callMethod?
  n.callMethod.applyundefinedn,arguments):n.queue.pushundefinedarguments)};
  ifundefined!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version=&#039;2.0&#039;;
  n.queue=[];t=b.createElementundefinede);t.async=!0;
  t.src=v;s=b.getElementsByTagNameundefinede)[0];
  s.parentNode.insertBeforeundefinedt,s)}undefinedwindow, document,&#039;script&#039;,
  &#039;https://connect.facebook.net/en_US/fbevents.js&#039;);
  fbqundefined&#039;init&#039;, &#039;297724064527547&#039;);
  fbqundefined&#039;track&#039;, &#039;PageView&#039;);
&lt;/script&gt;
&lt;noscript&gt;&lt;img height=&quot;1&quot; width=&quot;1&quot; style=&quot;display:none&quot;
  src=&quot;https://www.facebook.com/tr?id=297724064527547&amp;ev=PageView&amp;noscript=1&quot;
/&gt;&lt;/noscript&gt;
&lt;!-- End Facebook Pixel Code --&gt;
------------------------------------

With this code, you can save to Blogspot without any problems. Remember to change the green ID segment to yours.

And you can visit this site web if any problems you have: http://bit.ly/2VcDuYY 

No comments

This Img about Ads

Ad blocker detected

Ads help us fund our site, please disable the ads blocker and help us provide exclusive content to you. Thanks for the support ❤️❤️