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
-
Cross domain tracking Google Analytics
Hi there, Got a question on cross domain tracking: We have a couple of TLD's to serve localized content to our visitors, next to our main .com TLD where our app is running as well in a subdomain. Situation is this: Local sites:
Reporting & Analytics | | jorisbrabants
marketingsite.be
marketingsite.com.br
marketingsite.fr Main site: marketingsite.com
app.marketingsite.com Conversion gets triggered when somebody ends up in app.marketingsite.com/firstuse for example. People can sign up at the local site filling in their email but they end up in app.marketingsite.com/firstuse Reading this article on cross domain tracking I'm getting a bit confused on the setup of the tracking code itself. The sample code provided shows these two lines: ga('require', 'linker'); ga('linker:autoLink', ['maindomain.com','targetdomain.com']); Now the question 🙂 Is it correct when I think that maindomain should be replaced with our local TLD's on every one of those, and that targetdomain is where the conversion happens? In this case the .com site?0 -
How to Configure Google Analytic API?
Hello All, I want to implement google analytic api can any one show me the whole process? Regards, Mit
Reporting & Analytics | | mit0 -
Universal Analytics - is it awarding traffic incorrectly ?
A few days ago deployed a new site. A funny thing happened within one day. Google Analytics commenced reporting Organic traffic as lifting by 25%. At the same time Google Analytics commenced reporting that direct traffic dropped by 25%. All other traffic sources remained at the same level. This is all being reported through GA Universal. Has anyone experienced this before? Any advice is appreciated. Also noted that with Google Webmaster is reporting, since the day of the new site deployment, a 40% drop in impressions and click. Reported referrals on this deployment day also went through the roof. All of the Google tools I am depending on are not supporting my discovery of a solution to this. If anyone has been through this on universal analytics or traditional analytics please help! Offering lots of good karma points in return. Cheers.
Reporting & Analytics | | Oxfordcomma0 -
Different transaction data social channel on Google Analytics
Hi there, On my ecommerce, in order to find out the number of transactions that came directly from my social channels I go to Acquisition->Channels and then I look at the column Transactions for the Social channel. Surprisingly this number differ from the one that I find under Acquisition->Social->Overview and then I select Transaction under Conversions. Then I look at Last interaction Social Conversions to find the number of transactions. The two quantities are totally different for a month window and they should be the same. Can any of you explain to me the reason why? Thanks and regards
Reporting & Analytics | | footd0 -
I have just found that Google Analytics are suggesting everyone upgrade to their new Universal Analytics, will this affect my MOZ account? should I do it now or wait till they default the updgrade?
Here is the link from google developers https://developers.google.com/analytics/devguides/collection/upgrade/guide#overview
Reporting & Analytics | | Jacquie_AegisSafety0 -
Multiple domains to one payment sub-domain in Google Analytics
Hi Mozzers, I have a series of sites (~25) that are all regional e-commerce sites with the same URL structure eg. www.[region]-product.com as well as a 'master' site (eg www.product.com). I also have a single Adwords PPC account which point to all of the regional sites as well as the master site. As part of the payment/checkout process you only ever get taken to a sub domain of the master site (eg payment.product.com). My question is: Is it wise to use the single PPC Adwords account to set up an Analytics account under which I list all of the regional sites and the master site? Once that's done I'm not entirely sure how I can track sales from a regional site to the payment process of the master site and have sales correctly assigned to the right domain. On the payment process I can only use one site ID tracking code so I'm not even sure I can correctly assign a transaction to a single site if multiple sites use the same payment pages. Example: Visit to region-product.com > Quote form submitted to payment.product.com > Payment completed on payment.product.com > Sale is assigned to which domain? Can anyone who understands what I'm trying to achieve comment on the plausibility of this? Many many thanks!
Reporting & Analytics | | panini0 -
Looking for a Google Analytics expert
Looking to hire a Google Analytics expert for a project. Dealing with trying to track traffic across multiple domains and then work with the Ecommerce options. Contact Jeff Logan @ Avelient with costs and time frame for work. [personal information removed by editors. please contact via private message system to exchange information]
Reporting & Analytics | | Avelient0 -
Google analtyics code placement
I saw that Google suggests the analytics code be in the , will this effect the page load if it is in here? Also, is it a problem to have it in the body?
Reporting & Analytics | | Gordian0