Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Google Analytics and Google Tag Manager 2 on a local address?

I'm relatively new to GTM and have been experimenting with the new interface which will be fully replacing the original on 1 April: https://support.google.com/tagmanager/answer/4605576.

However, I have encountered some issues getting Google Analytics to register pageviews when testing on a local address. There is a solution for this using the original GTM layout outlined here: Track localhost on Analytics in Google Tag Manager, so I don't wish to ask a duplicate question. However, in the new Google Tag Manager design there is no longer an option to set Cookie Domain to 'none', so how could I now test Google Analytics and GTM from a local address?

like image 220
James Darrall Avatar asked Dec 20 '22 05:12

James Darrall


1 Answers

If you go to "fields to set", click on "add new field" and start typing into the "field name" input box the autosuggest function will suggest applicable field names (i.e. if you start typing "coo" it will suggest everything related to cookies, including the cookie domain).

"Behind the scenes" GTM has always used the "set fields" mechanism of GA, this has now been made explicit in the interface. But this does make a difference to the way GA tracking works, so simply "set field"->"cookieDomain" to "none" and everything will work like before.

like image 56
Eike Pierstorff Avatar answered Apr 28 '23 11:04

Eike Pierstorff