Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

So I got my Google Analytics set up via Google Tag Manager. Page views tracking is working fine. But when I try to track any events, the data is just not getting through to Analytics. The event tracking did not work with traditional Analytics code either.

Analytics debug is showing several "Create config had an unknown parameter: x" and "Command ignored. Unknown target: undefined"

Supposedly this means that there is something wrong with my tracker name. I have tried both default name and custom names.

Might be worth mentioning: Until recently, my site's default URL was wrong in Analytics site preferences, but I'm not sure if that has anything to do with this.

Analytics debug message:

Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("create", {2: null, 3: null, 6: "1", 10: false, 11: false, 12: false, 16: false, 17: false, 18: false, 28: false, 32: "UA-1439995-1", 33: false, 34: false, 35: [{fieldName: "cookieDomain", value: "auto"}]}, {name: "gtm5"})
analytics_debug.js:10 Creating new tracker: t0
analytics_debug.js:10 Create config had an unknown parameter: "2"
analytics_debug.js:10 Create config had an unknown parameter: "3"
analytics_debug.js:10 Create config had an unknown parameter: "6"
analytics_debug.js:10 Create config had an unknown parameter: "10"
analytics_debug.js:10 Create config had an unknown parameter: "11"
analytics_debug.js:10 Create config had an unknown parameter: "12"
analytics_debug.js:10 Create config had an unknown parameter: "16"
analytics_debug.js:10 Create config had an unknown parameter: "17"
analytics_debug.js:10 Create config had an unknown parameter: "18"
analytics_debug.js:10 Create config had an unknown parameter: "28"
analytics_debug.js:10 Create config had an unknown parameter: "32"
analytics_debug.js:10 Create config had an unknown parameter: "33"
analytics_debug.js:10 Create config had an unknown parameter: "34"
analytics_debug.js:10 Create config had an unknown parameter: "35"
Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("gtm5.set", "&gtm", "G32NJ6NK7K")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("gtm5.set", "nonInteraction", false)
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("gtm5.set", "hitCallback", [function])
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("gtm5.send", {hitType: "event", eventCategory: "contact-form", eventAction: "successful-form-submission-mailsent", eventLabel: "362", eventValue: undefined})
analytics_debug.js:10 Command ignored. Unknown target: undefined

Analytics debug message screenshot

like image 750
juha t Avatar asked Mar 10 '18 17:03

juha t


2 Answers

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.

like image 151
juha t Avatar answered Oct 01 '22 21:10

juha t


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.

like image 25
user3015648 Avatar answered Oct 01 '22 22:10

user3015648