Breaking News

How We Finally Got Google Tag Manager Work on Blogger

Google Tag Manager is a tag management system is a system that allows you to quickly and easily update tags and code snippets on your website or mobile app. Basically what this does is to reduces errors and frees you from having to involve a developer when configuring tags or editing site code.
how to fix google tag manager error in blogger

Below are step-by-step instructions for setting up / implement Google Tag Manager in Blogger.

1. Copy the Bellow JavaScript and paste it as close to the opening <head> tag as possible in your Blogger template, replacing GTM-XXXX with your own container ID:


&lt;!-- Google Tag Manager --&gt;<br />
&lt;script&gt;(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':<br />
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],<br />
j=d.createElement(s),dl=l!='dataLayer'?'&amp;l='+l:'';j.async=true;j.src=<br />
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);<br />
})(window,document,'script','dataLayer','GTM-XXXX');&lt;/script&gt;<br />
&lt;!-- End Google Tag Manager --&gt;

2. Copy the Bellow snippet and paste it immediately after the opening <body> tag in your Blogger template, replacing GTM-XXXX with your container ID:


&lt;!-- Google Tag Manager (noscript) --&gt;<br />
&lt;noscript&gt;&lt;iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"<br />
height="0" width="0" style="display:none;visibility:hidden"&gt;&lt;/iframe&gt;&lt;/noscript&gt;<br />
&lt;!-- End Google Tag Manager (noscript) --&gt;
In blogger you will see the following error
At this when you try to save blogger returns this error message: Error parsing XML, line 10, column 43: The reference to entity "l" must end with the ';' delimiter.

This is as a result of the way Google parses Blogger XML, To fix this all You need to do is to replace this line of code with the one highlighted in GREEN:


  • j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  • j=d.createElement(s),dl=l!='dataLayer'?'&amp;='+l:'';j.async=true;j.src=


Replace &l with: &amp AND That should Fix the Google Tag Manager Blogger error. After you replace the code and save the template you will not get the error message.
Hope this works for Every one Faceing this issue.

No comments