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 change domains in Google Analytics without losing the data
Hi there, We recently changed our domain from .COM to .NET so that all our subdomains from external pages matched. Right now in Google Console we have our new .NET website being tracked, but in GA we are still tracking .COM. It is also causing issues with MOZ crawling our site because of the .COM/.NET discrepancy. My question is what is the best way to change our Google Analytics from .COM to .NET without losing historical data and what considerations do we need to change before implementing this? Our team was concerned that just downloading the old data would be too vast and it we wouldn't be able to continue manipulating it dynamically in GA. Thanks!!
Reporting & Analytics | | cPanel-LLC.0 -
Does Universal Analytics auto generate events?
Hi Mozzers, I have been noticing for one of my clients that there are thousands of events generating which I never added a code snippet for ga('send', 'event', 'button', 'click', 'nav buttons', 4);. The code I am seeing instead is following the syntax **PDF FILE NAME.**I don't even use Tag Manager. So are these auto generated? Label names of files aren't great though so I still believe that adding that piece of snippet _ga('send', 'event', 'button', 'click', 'nav buttons', 4);_can still bring some added value. Do you think it still does? Thanks!
Reporting & Analytics | | Ideas-Money-Art0 -
Is it possible to import data from an old Google Analytics profile to a new Google Analytics profile?
We have encountered a situation where a client's old SEO firm is refusing to grant us Admin access to our client's existing GA account. For security purposes (so the other SEO firm doesn't delete the existing GA profile) we have started a new Google Analytics profile. Again we do have access to the data in the old account. Is it possible to migrate this old data over (if we just have user access)? Thanks for the help
Reporting & Analytics | | RosemaryB0 -
Site account in Google Analytics
Hello I have a question about my site account. On 2014, during a week, my ID tracking of Google Analytics was removed of the site, in this period the volume of users and sessions is lower than the other weeks. But I don't understand why are the sessions and users still reporting during this period without ID Tracking
Reporting & Analytics | | Arkix0 -
Google Analytics Organic Keyword (Not Provided) Alternative Hacks?
I'm sure everyone is sick of the (Not Provided) keywords because I know I am, and Google reckons that you should only see 10% or less (I'm currently around 13% and growing). I am seeking alternatives or hacks that will help display the keywords? If you have a hack to actually display the keywords, please share it your ideas and thoughts? I recently implemented a hack that will show the landing page of the keywords which is better than nothing. But as an eCommerce site, I have about 10% of my transactions which not provided, knowing the keywords would really help. Would love to hear your thoughts?
Reporting & Analytics | | upick-1623911 -
Google Analytics Report throws up Google as a referrer
Good morning from Wet & Windy 12 degrees C wetherby UK... Using Google analytics I've noticed in the traffic sources refferer subsection some traffic is categorized as originating from Google. Whats puzzling me is.... I know a huge amount of traddic stems from Google but as the below screenshot illustrates only 21 visitors come from Google: http://i216.photobucket.com/albums/cc53/zymurgy_bucket/google-refferal-sources-top-levelcopy.jpg And when i drill down some are coming from Google mobile 😞 http://i216.photobucket.com/albums/cc53/zymurgy_bucket/google-referral-sourcescopy.jpg Is traffic categorised as Google referrer down to Google hiding searches via ssl as explained here: http://i216.photobucket.com/albums/cc53/zymurgy_bucket/google-referral-sourcescopy.jpg Any insights welcome 🙂
Reporting & Analytics | | Nightwing0 -
Setting Up Google Analytic with Sub Folder Sites
What is the best way of setting up Google Analytic for a website that has many sub folders? The main site is example.com and it has 40 sub folder sites like example.com/uk example.com/France etc etc Would it be advised to track a single domain in Google Analytic then create filters for the sub folder sites. Filters > Include traffic from > Sub directories Also with this method is it possible to view overall incoming website stats for everything? Previous experience would be great with this thanks 🙂
Reporting & Analytics | | daracreative0 -
Strange increase in Direct traffic in Google analytics
For past 2 weeks, several of our sites have strange increase in direct traffic in Google Analytics. we also have another tracking code, and in this account we don't have any big changes, so this is very strange what is happening. We didn't changed any codes, and none of the changes were done to application. Any ideas why this is happening? z7ME9.jpg
Reporting & Analytics | | InformMedia0