July 20, 2019

How to Start Using Google Analytics with Your Blog!

How to Start Using Google Analytics with Your Blog!  

So before you start using Google Analytics (which is free if you didn't know.  Google bought Urchin Software in 2005 made it free for merchants..why? I'll let u know later)

You need to implement Google Tag for it to work correctly.  

Add Google Tag Manager To Your Blogger Blog

You can add the Google Tag Manager code to the HTML template.  (similar to Wordpress).. But there's a small catch ...

You need to change the ampersand (&) to its HTML encoded version (&) 

due to strict encoding schema in Blogger template. 

To edit the HTML template of your Blogger blog, click the Template menu item in the main navigation of your blog settings, and then choose Edit HTML in the screen that is displayed.

Next, copy-paste the GTM container snippet into its rightful place just after <body>.

In the container snippet, find the following string: dl=l!='dataLayer'?'&l='+l:'';, and change the ampersand (&) to its HTML encoded counterpart (&), so that the string looks like this: dl=l!='dataLayer'?'&amp;l='+l:'';.

This needs to be done, as the template format used in Blogger has a strict encoding schema, and unescaped or non-encoded special characters such as ampersand will cause errors in the template if not fixed.

No comments:

Post a Comment