简体   繁体   中英

Google Analytics via Google Tag Manager not tracking root url /

I am using Google Tag Manager to track with Google Analytics, however, no traffic is being shown for / , while a lot of traffic is being tracked for other internal urls. This is inaccurate, as I have personally navigated to / . I am using a lookup table to change the GA tracking id based on environment (I have development and production), but since some traffic is being tracked, I don't think it has anything to do with the configuration. But I'm really at a loss for what's happening. Anybody every seen something like this? Any help very much appreciated!

So, I changed 2 things and the problem went away. I believe that the first change with GTM environments fixed it, but I will explain both.

GTM provides a default <script/> tag for installation. However, when using environments, the <script/> tag has some parameters added to it. If you go to admin > environments > actions (for your environment), you can select "Get Snippet". If you look closely at this snippet, you'll notice that it has the following parameters added: &gtm_auth , &gtm_preview . I had previously assumed that the default snippet would work okay for my default "Live" theme, but I think that the parameters are actually necessary in order to correctly send data through if you're using a lookup table to select the environment as I am.

Secondly, I realized inside of Google Analytics that both "Property Settings" and "View Settings" under "Admin" have an optional default url. In my case, I had incorrectly set this to use http instead of https for both, and I had not explicitly set the "View Setting" default url.

Hope the helps someone out there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM