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 Analytic Bug For Browser Report
Hi All, I am checking browser report since many years today I was checking browser report what I find "DESKTOP" is showing in Browser & OS section with lots of traffic. Screenshot attached Is it google analytic bug? Can anyone please help me? PeGK7
Reporting & Analytics | | Arnold30 -
Tracking Product Codes
Hey Mozzers, We are improving our B2B site by adding product codes to headings & meta information etc to gain some traction ranking for our own products and those supplied by others when searched for by product code. Almost immediately we are hitting the top half of the first page for most of these and seeing some nice results. We would like to track our placement for these product codes in google but feel this would be a waste of our Moz Keyword limit and we really dont need to check them once a week, just one a month or so. Has anybody got any methods of tracking our ranking for a a big list of keywords say once a month which isn't too labour intensive? Many Thanks
Reporting & Analytics | | ATP0 -
Google Analytics - Average Position
Hi Just trying to get some clarity on Google Analytics Average Positions in "Aquistions/Search Engine Optimisation". For a very competitive keyword Google Analytics is saying i am on average position of 6. Is this Page 6? I am assuming position six would be 1.6?
Reporting & Analytics | | Cocoonfxmedia0 -
Google Analytics, new property or views?
Hi All We have an existing Google analytics account which was customised relatively heavily a few years back, with custom variables, e-commerce tracking and the a large number of filters. We have determined that the custom variables and e-commerce tracking, at least for now, are no longer required and actually complicating our lives. We want to simplify the account and add a fresh set of goals and events. Our initial train of thought was to create an entire new property with the usual views, raw, test, main etc. We are proposing to retain both properties (6 months) so we can still do some comparative stuff. We're now wondering if we should retain the existing property and just create new views, the downside being that whilst we can compare data with previous periods it's meaningless to some degree as the filters etc are different. The plus of more views is that we're not firing the tag twice retaining two properties. Views and opinions welcome. Thanks
Reporting & Analytics | | mde9110 -
Showing significant visit in google analytics
Hello Everyone, I was checking GA account of my site and I have found there are few keywords have significant number of visits in GA. These keywords not ranking even in hundred(google SERPs).I am not understanding from where these visitors coming .Please help me out. I am attaching screenshot of those keyword.Last but not least when i check source of these keywords source are google. Thanks aScZ8WT.png
Reporting & Analytics | | Alick3000 -
Setting up goals - google analytics
Hi Im new user google analytics I would like to set up goal for website. I asked to basic questions: What are my bussiness objectives? Answer:make the visitor to click on a advertisment (affiliate links and affiliate banners) to be redirected to company website to finish purchase. How to set up goals? How can I track ads (affiliate banners and affiliate links) on my website?
Reporting & Analytics | | info_tipovanie-stavkovanie.com0 -
Google Analytics-Unique visitors?
Does organic search data show unique visitors or all visits? For example, if someone ( a single person) visits my site multiple times after searching the same keyword phrase, does that show in my analytics data as 1 hit from that keyword, or all hits? Thanks!
Reporting & Analytics | | RickyShockley0 -
Google Analytics Customer filters & the correct syntax
Good afternoon from torential rain and thunder Wetherby UK 😞 Ive been delving into the world of custom filters in Google analytics and Ive hit a problem. Apart from Googles advice being out of date (wont get into that one) I wanted to set up clone a profile of an existing site and set up a filter that would exclde USA traffic. But a country can be called many things e.g. United Sates USA America so how do you know what is the correct name to put in the filter pattern box? Here is a screen shot of my efforts :http://i216.photobucket.com/albums/cc53/zymurgy_bucket/filter-toexclude-usatrafficcopy.jpg (I chaned it to United States) So my question is where is there a list of the correct syntax for the filter pattern box? Taker for example you wnated to set up a custom filter to include just Palm OS traffic apprently from reading this the correct filter patter is Palm OS, i only know that from this http://www.e-nor.com/blog/web-analytics/tracking-mobile-devices-in-google-analytics Whilst Google has lots of documentation about filed patterns as documented here http://support.google.com/analytics/bin/answer.py?hl=en&answer=1034380&topic=1034830&ctx=topic Where in the name of flying spacial jockstraps is there documentation for the correct filter pattern syntax. Help my head hurts 😞
Reporting & Analytics | | Nightwing0