Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Track localhost on Analytics in Google Tag Manager

I have a problem with tracking Google Analytics on localhost with Google Tag Manager. I can see on the API for Analytics ( https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#localhost), all i need to do is to set cookieDomain to none. I do not find this option in Google Tag Manager. Does anyone know how to do this?

like image 328
Numm3n Avatar asked Jun 21 '13 09:06

Numm3n


People also ask

Can Google Analytics tracking localhost?

Both Global Site Tag - gtag. js and Universal Analytics - analytics. js will detect localhost automatically. You do not need to make any change to the configuration.

Does Google Tag Manager work on localhost?

If it does show up, make sure that your tags have appropriate triggers so that they are instructed to fire. But the TL;DR - Yes, you can use GTM on "localhost".


1 Answers

The documentation referenced it is about the Universal Analytics (new GA API version).

To solve this problem, you have two options:

1) Using the traditional tag "Google Analytics", in 'More settings' > 'Domains and Directories' > 'Domain Name':

none

2) Or switch to the "Universal Analytics" tag in Tag Google Manager, configure the required fields and in 'More settings' > 'Cookie Configuration' > 'Cookie Domain':

none

In both cases, this option should be turned off before the launch of the site.

like image 131
Fabio Phms Avatar answered Oct 05 '22 12:10

Fabio Phms