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
-
Tracking 301 redirect traffic in Google Analytics
if I 301 redirect www.mywebsite.com to go to www.yourwebsite.com, how can I track the traffic in Google Analytics that is coming from mywebsite.com?? I don't think that's a referral traffic, is it?
Reporting & Analytics | | Armen-SEO0 -
Google Analytics Landing Page Report Discrepancy
I have noticed that when I run a landing page report and use the advanced option so I can view only the landing pages that include a particular string in the URL, have noticed that I in the report, the graph at the top will say one thing, but the data below says something else. For example, the graph for one particular search shows 200 Impressions, but the info below says 700 impressions and 610 clicks. Anyone seen anything similar or have any ideas why? Thanks! Craig
Reporting & Analytics | | TheCraig0 -
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 -
Why is Google Analytics showing index.php after every page URL?
Hi, My client's site has GA tracking code gathering correct data on the site, but the pages are listed in GA as having /index.php at the end of every URL, although this does not appear when you visit the site pages. Even if there is a redirect happening for site visitors, shouldn't GA be showing the pages as their redirect destination, i.e. the URL that visitors actually see? Could this discrepancy be adversely affecting my search performance? Example page: http://freshstarttax.com/innocent-spouse/ shows up in GA as http://freshstarttax.com/innocent-spouse/index.php thanks
Reporting & Analytics | | JMagary0 -
Google Analytics for multiple languages on multiple domains
Hi folks A quick question in regards to setting up Google Analytics for a website with multiple languages on multiple domains. The domains that needs to be tracked are: www.example.com -> English www.example.se -> Swedish www.example.dk -> Danish To my best knowledge this can be acheived in Google Analytids using 3 different setups: Different accounts Different properties Profiles What would you guys consider the best approach?
Reporting & Analytics | | Resultify
Pros and cons? Have a great day Fredrik0 -
How to change a url for google analytics account
We recently changed the url of a client's website. Is there a way to change the url on the ga account instead of creating a new account so that we don't lose comparative data? Thanks! Sorry- I know this is a novice question.
Reporting & Analytics | | marketing12340 -
Editing Google Analytics eCommerce Javascript for Volusion
Does anyone know how to edit the ecommerce javascript with Volusion dynamic variables? I thought I did it correctly but none of the information got recorded in GA. It recorded that there was a transaction made but not info on the purchase price, order #, etc. This is the current code I am using: NOTE: In Volusions customer support center they provided this information: Where Order-Specific Information is Generated Order-specific information can be generated by JavaScript on the OrderFinished.asp page within Volusion. On this page, two JavaScript arrays will be initialized that advanced users may need to be aware of. The arrays and their contents are as follow:
Reporting & Analytics | | jhooley
Order Array Contents Order[0] = Order ID
Order[1] = Unused
Order[2] = Payment Amount
Order[3] = Affiliate Commisionable Value
Order[4] = Sales Tax
Order[5] = Total Shipping Cost
Order[6] = Billing City
Order[7] = Billing State
Order[8] = Billing Country OrderDetails Array Contents OrderDetails[X][0] = Order ID
OrderDetails[X][1] = Order Detail ID
OrderDetails[X][2] = Product Code
OrderDetails[X][3] = Product Name
OrderDetails[X][4] = (unused)
OrderDetails[X][5] = Product Price
OrderDetails[X][6] = Quantity Note that in the above example, X refers to a line item number (beginning from zero). Note that there can be multiple Order Details arrays - one for each item contained within an order. I'm a newbie at Analytics installation and could really use any help. Thanks!1 -
Google Analytics' Goals and Cold Fusion
We are having an issue tracking goal completions in GA with a cold fusion site. I would like to know if anyone as had similar issues and found a solution.
Reporting & Analytics | | JamesBarry0