March 19, 2021

Blogger: Set up Google Analytics to new dynamic tag (gtag.js)

I got this email by Google Analytics:

I thought my Blogger blog was properly set, but checking at the page source code it wasn't.

Check

I thought my blogger settings for GA were properly set:

Setting the Tag in the Settings does not seem to be enough. It looks like the feature wasn't updated to use the new tag. This is how the page source looks like:

Definitely the old tag.

How to fix

Get the new Gtag code snippet from Google Analytics-> Settings->Admin
Google Analytics - Get gtag.js code snippet


Edit your Blogger Theme Html Template (Theme->Edit HTML)
And paste the Gtag code snippet just below the <head> tag

You can then test the traffic.

You can remove the GA Property ID from your Settings.

No comments:

Post a Comment