“Invalid tracking Id. Aborting hit.” for Event Tracking

≡放荡痞女 提交于 2020-04-30 07:35:02

问题


I have 2 ecommerce sites hosted on Shopify and Google Analytics properly implemented on both sites. I check my analytics daily, all that's good. Recently, I've been trying to do event tracking every time someone adds a product to their shopping cart.

Pretty much following this tutorial.

So I added the following to my add to cart buttons: onclick="_gaq.push(['_trackEvent', 'Products', 'Add To Cart', 'some-product-title']);" . This is working perfectly on my first ecommerce site, I see the event being tracked in Google Analytics.

On my second site however, it's not going through and I'm getting an error... using the GA Debugger, I tried doing that event tracking command in the console: _gaq.push(['_trackEvent', 'Products', 'Add To Cart', 'some-product-title'])

I get the following error: Invalid tracking Id. Aborting hit.

What does this mean? Trying to figure out how GA is being implemented differently on both sites, but can't figure it out. Thanks


回答1:


Perhaps your new site is using Universal Analytics (analytics.js)? If that is the case, you'll have to update your event syntax to:

ga('send', 'event', 'Products', 'Add To Cart', 'some-product-title');


来源:https://stackoverflow.com/questions/24772574/invalid-tracking-id-aborting-hit-for-event-tracking

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