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
-
How to set and understand behavior flow in google analytic?
Hello Experts, How to set and understand behavior flow in google analytic? I have attached screenshot of my behavior flow it is showing not set. So how to set? Thanks! MAQnG SQ7QM
Reporting & Analytics | | micey1230 -
Has Google Analytics Funnel Visualisation changed / stopped working?
Yesterday my funnel visualisation tab in the updated GA interface was showing data flow. However today there is nothing showing in the graphical element despite showing some goal completion figures as a headline. Have they stopped doing up to the minute visualisation in favour of delayed results? Anyone else experiencing similar? Thanks in advance Tim
Reporting & Analytics | | TimHolmes0 -
Two Analytics Code
Hi Moz Community! I've been working with a client’s website and found it has 2 analytics code with same ID. I need to understand which one is correct before removing anyone of them, below are the both scripts. First one Second one Any help would be appreciated! Regards, S
Reporting & Analytics | | ShaunPhilips0 -
Complete loss of Organic visits within Google Analytics??
Hey guys, I have a pressing query that's really puzzled me! I've just been going through Google Analytics and noticed that there has been a complete drop off of all my organic visitors from May 7. All other traffic mediums are unaffected so there is no issue with the Analytics code recording visits. I haven't received any penalty and my rankings have actually improved in the last month. This is proper bizarre. Any ideas? MjLmL70.png
Reporting & Analytics | | Webrevolve0 -
Is it possible to use Google Tag Manager to pass a user’s text input into a form field to Google analytics?
Hey Everyone, I finally figured out how to use auto event tracking with Google Tag Manager, but didn't get the data I wanted. I want to see what users are typing into the search field on my site (the URL structure of my site isn't set up properly to use GA's built-in site search tracking). So, I set up the form submit event tracking in Google Tag Manager and used the following as my event tracking parameters: Category: Search Action: Search Value When I test and look in Google Analytics I just see: "search" and "search value." I wanted to see the text that I searched on my site. Not just the Action and Category of the event.... Is what I'm trying to do even possible? Do I need to set up a different event tracking parameter? Thanks everyone!
Reporting & Analytics | | DaveGuyMan0 -
How to track what people type on my text boxes on Google Analytics?
Hi there! In our website, we have a few text boxes that users need to use to complete the goal. The boxes aren't search boxes, but it's still important to us to track what people type on it. I'm looking for a way to track the data through the "event" feature in Google Analytics, but it seems that this tracker can only calculate clicks, or video views etc. Does anyone knows how to track do it?
Reporting & Analytics | | ivan.precisodisso0 -
Google Shopping & Keyword Tracking
When tracking Google Shopping using the URL builder is it possible to pull through the Keyword used or will analytic do this automatically?
Reporting & Analytics | | TPSUK1 -
Seeing / and no / in Google Analytics
When I look at my Google Analytics code, I see that the same content will show up twice, once with a / at the end of the URL, and once without. My site is at http://www.skypeenglishclasses.com. Does anyone know why this would happen? Is it duplicate content?
Reporting & Analytics | | Paulguy0