Google Analytics Settings value showing a “{}” in google tag manager's preview mode

泪湿孤枕 提交于 2020-03-05 06:06:29

问题


I'm facing a problem that none of the google tags fire on the website.

For example, this is what I see in the page view event google analytic tag not firing successfully

FYI: This is the setting of my Google Analytics variable: Google Analytics Setting Variable

Here is the webpage link: https://www.canfitpro.com/convention-2020/

I'm wondering if anyone knows what is happening here and how to fix it? Thanks a lot for the help!


回答1:


The subdirectory install of WP that you linked to when checked with tag manager is showing a different GA tracking ID in place to that in the screenshot of your GTM GA Settings Variable, and seems to indicate it is not firing pageviews via a tag in GTM. Tag Assistant is indicating a Universal Analytics tracking code snippet for UA-110328630-1

Initializing Google Analytics.
analytics_debug.js:25 Running command: ga("create", "UA-110328630-1", "auto")
analytics_debug.js:25 Creating new tracker: t0 

The main website installation https://www.canfitpro.com shows the install of the same GTM container and does indicate pageviews firing for via GTM

Initializing Google Analytics.
analytics_debug.js:25 Running command: ga("create", "UA-110328630-1", {name: "gtm1"})
analytics_debug.js:25 Creating new tracker: gtm1

Did you refresh the GTM container after making changes in it, so that debug and preview mode in GTM would acknowledge the changes?

If you have published the container with the changes, have you flushed the site cache for whatever site caching is being used?

Alternatively, in some instances where a GA installation is restricted to a subdirectory, you will need to set cookiePath to the subdirectory. Which would be done in the GA Settings Variable under Fields to Set option

By default, Google Analytics sets the cookie path to the root level (/). In most situations, this is the appropriate option and works correctly with the tracking code you install on your website, blog, or corporate web directory. However, in a few cases where user access is restricted to only a sub-directory of a domain, this method can resolve tracking issues by setting a sub-directory as the default path for all tracking.

https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs#cookiepath




回答2:


From your first screenshot I see that you have true value for 'Enabled overriding settings in this tag'. To prevent your Google Analytics Settings variable from being overwritten you should remove that tick from the Analytics Tag.

However it is very strange that you see {}, it may be that you have a second Google Analytics Settings variable that you have created but that is empty and you have incorrectly associated it with the tag instead of the good one.



来源:https://stackoverflow.com/questions/60423033/google-analytics-settings-value-showing-a-in-google-tag-managers-preview-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!