Google Analytics not receiving events (Command ignored. Unknown target: undefined)

半城伤御伤魂 提交于 2019-12-06 02:02:40

I believe I have found a solution.

I edited my Universal Analytics tags (Contact Form Submission and GA-Pageview) in GTM by setting tracker names to blank.

(Edit Tag -> Enable overriding settings in this tag -> More Settings -> Advanced Configuration -> Set Tracker Name [True]

I have no idea why I had to do this and if this is a good solution. But now event tracking seems to work.

I had this same problem. I had set my variable " tracking id" to type google analytics settings, instead of constant. Changing to constant removed this strange create function.

This is part of the answer: when you create your tracker initially, although you assign the name gtm5, the tracker is assigned the default name t0. Therefore when you refer to gtm5 in the later calls gtm5.set, it fails, and that's the error you're getting (Command ignored. Unknown target: undefined, target being the tracker name you're referring to).

Now what I don't understand, is that the screenshot you provided, the Google Analytics settings look pretty much standard, whereas in the debug, we see custom fields trying to be assigned ({2: null, 3: null, 6: "1", 10: false). GA seems confused by that syntax, hence why it ignores your {name: "gtm5"} option and assign the default t0 name.

Are you sure the screenshot you provided is related to the debug we see (for me it doesn't seem like so, the GTM debug mode would help you find out).

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