问题
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