Google Universal Analytics - Command Ignored

I am using Google Universal Analytics to track pageviews. I can see when I go to the pages with a realtime feature on the Google Analytics site, so my code should work.

However, Chrome keeps displaying this in the console:

Initializing Google Analytics   
    Running command: ga("set", "page", "/My Url here")
    Command ignored. Unknown target: undefined
    Running command: ga("send", "pageview")
    Command ignored. Unknown target: undefined

      

Soon there is actual data in Google Analytics, which, combined with my view in a live dashboard, means the data is being successfully submitted. So what happens if GA thinks the command is undefined, why is it submitting it anyway?

+3


source to share


1 answer


I would check that your GA initialization is correct. Make sure your UA # is inside an instruction like this.

ga('create', 'UA-XXXX-Y')

      



It looks like your data is showing in real time in the report.

Make sure the code you posted above runs below the GA initialization code and the initialization code is at the end of GA and right after using GTM.

+2


source







All Articles