Universal Google analytics e-commerce tracking code?
-
Hi Mozzers,
I have never setup a universal google analytics e-commerce tracking code before and my concern is what exactly do I need to add on the cart thank you page?
Can someone send me a sample of code I need to be adding? What kind of customization does it require?
The more details you can provide the better!
Thanks!
-
Thanks Martjin!
-
Hi Taysir,
No they won't need their own thank you page. Usually a shop will have their own thank you page for all products. I don't have any experience running this through Tag Manager but usually how it would work that you have an array of data on the products that you sold and that you loop through it.
As all of this usually runs from the back-end of a shop it's something you should talk about with your developer on how they can do this the best way possible.
-
Hi Martijn,
Thanks for your response! The one part I am confused about is that it seems that each product will need their own thank you page with the product specifics on the tracking code. Is that correct?
If this the way to implement it, how do you manage to create multiple tracking codes for multiple products? Tag manager would probably be recommended, right?
Finally if someone purchases multiple products we would need to have multiple additem' within the code? How do you possibly figure out all the scenarios for different items to add when the e commerce carries 100s of products?
Thanks for letting me know!
-
I hope you don't use that for tracking e-commerce as it doesn't contain the e-commerce tracking To enable e-commerce tracking you need a couple of JS functions. All the documentation you'll need around this topic can be found here: https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
ga('require', 'ecommerce'); is the first to load the GA E-commerce Library.
ga('ecommerce:addTransaction', {
'id': '1234', // Transaction ID. Required.
'affiliation': 'Acme Clothing', // Affiliation or store name.
'revenue': '11.99', // Grand Total.
'shipping': '5', // Shipping.
'tax': '1.29' // Tax.
});This part is where you fill in all the details of the transaction, so it's a summary. In the next step you'll add all the needed data for the items within the transaction.
ga('ecommerce:addItem', {
'id': '1234', // Transaction ID. Required.
'name': 'Fluffy Pink Bunnies', // Product name. Required.
'sku': 'DD23444', // SKU/code.
'category': 'Party Toys', // Category or variation.
'price': '11.99', // Unit price.
'quantity': '1' // Quantity.
});The last command: ga('ecommerce:send'); will send the transaction to GA.
-
Hi Taysir,
You might find this helps: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce
my code is:
-
Are you using an particular flavor of shopping cart or a custom e-commerce solution? You might want to try searching for plugins/extensions that can do this for you. Google Tag Manager is another way to do this.
-
Thanks for providing the doc but I have read them and still finding it confusing. I'd like to get a sample of the tracking code and what to customize within the code. Your google search is focused on classic GA and not universal GA.
-
Hi there. Read this google documentation: https://support.google.com/analytics/answer/1009612?hl=en
Or any article from first two page here: http://bfy.tw/267R
Cheers
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Google Analytics Campaign Tracking overriding each other
Howdy, fellow mozzers. So, here is the situation: Let's say someone comes to the website through Organic Google Search, and first thing they see is the banner on the website, on a click of which it takes you to a promotional landing page. I have this banner being tracked with GA campaigns. Now, here are my questions: If that user makes a purchase, which source / medium it will be assigned to? Organic/google or website/banner? (as far as i understand it assigns it to website/banner) If that's the case, is there way to find out afterwords where the website/banner sessions came initially from? If there is no such way, how shall i setup the tracking to be able to see wherre the initial visit to the website came from, yet also track how many people clicked on the banner and made a purchase? Thanks 🙂
Reporting & Analytics | | DmitriiK0 -
Potential Security Issues Installing Google Analytics GTM
Greetings MOZ Community!! My SEO firm plans has requested that Google Analytics GTM be installed on my website to better track goals and events. My developer will be responsible for installing the GTM script on my website and the SEO firm will actually configure GTM to track goals. Is anyone aware of GTM causing server errors/issues when installed? My developer claims that running GTM would create additional vulnerability to hacking. Is anyone aware of potential security risks from running Google Tag Manager? Once Google Tag Manager is installed, will it make the site more difficult for my developer to administer? Will there be increased risk of the code breaking? Overall, is GTM a big improvement over the existing version of Google Analytics? Is it worth the effort to install? My SEO firm is very much in favor of this upgrade. I would like to move forward provided there is no major downside. I look forward to feedback. Thanks, Alan
Reporting & Analytics | | Kingalan10 -
Google Analytics Events that lead to Goals (conversions)
Hello! I'm in the process of setting up Events in Google Analytics to track the performance of banner ads on our site. While that will take care of the action performed by the visitor (i.e. the click on the banner), it doesn't tell me if the visitor ultimately completed the form where the banner ad directs them (which is set up as one of out site's Goals). Once the Event is in place, will I be able to track the Goal conversions that it leads to? It's nice that Events will tell me which banner drove someone to the form, but if I'm not able to see if that Event led to a Goal conversion it seems like something will be missing. So, is this something that's already available within Goals or Events reporting, or is there an additional step I need to take? Thanks in advance for your feedback! Erik
Reporting & Analytics | | SmileMoreSEO0 -
Analytics package beside google analytics
Hi, What analytics package can i use to track ecommerce transaction besides gogole analytics that is free of charge? Thanks Arthur
Reporting & Analytics | | VivaArturo0 -
Google Analytics and backlinking
Let say I have my main site and my secondary site that is optimized for a slightly different set of keywords (nonetheless still relevant to my main site). I have several links from a secondary site to my main site. Secondary site is on a different C-block. Do you ladies and gentlemen think that if I put both websites under the same google analytics account, Google is going to penalize me or remove some of the juice that is flowing from secondary site to the main site because it would detect through GA that both sites belong to the same entity?
Reporting & Analytics | | SirMax0 -
Does using Google URL Builder override original source in Google Analytics?
During a free trial on Tatango, we send daily emails to customers to give them advice, resources, etc. We started using Google URL Builder http://www.google.com/support/analytics/bin/answer.py?answer=55578 to create individual links in each of these emails, but when the customer purchases a subscription now, the source in GA isn't Google, Facebook, Twitter, etc. they are all showing up as the source we created using the URL builder for each email. Does Google URL builder override the original source in Google Analytic?
Reporting & Analytics | | Tatango0 -
Does Google Analytics use your data against you?
I couldn't find this question answered anywhere in Q&A, so I apologize if it's a duplicate of another post. I heard, about a year ago on either Web Pro World, or Warrior Forum that Google uses your visitor data in your Google Analytic account to rank your site. Someone said that when they took out the Google code, their site went from the third to the first page within 48 hours. That was then verified over the next couple of weeks by others. Their thought was that regardless of the optimized page and incoming link, if the site wasn't getting visitors, then it would be penalized. Since Google has the data, they would be able to use it. I then started using another, paid, solution - getclicky.com. While I like clicky, there is some info Google has that clicky doesn't, everyone integrates with Google analytics - like SEOmoz, and I'm paying a monthly fee. Now that I'm a part of a community of experts, what do you think? Have you noticed Google ranking you based on your analytics data? Has anyone experienced this, or heard about it before? Because I'd like to go back to using Google analytics. Thanks!
Reporting & Analytics | | DallasBonsai0