Copy link to clipboard
Copied
I've successfully added ecommerce tracking for Google Analytics to my Business Catalyst sites. I haven't found any [free] definitive guides out there, so I thought I'd share.
For the tracking script, the Business Catalyst file you need to have opened is /Layouts/OnlineShop/order_receipt-US.html.
However, you also need to add the Google analytics script - with out the ecommerce modification - to all the pages on your site. I recommend putting in the <head> of your page templates.
To start tracking Business Catalyst ecommerce transactions with Google Analytics, here are the steps you need to take.
script type="text/javascript" var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-*******-*']); // your Google Analytics profile id _gaq.push(['_setDomainName', 'example.com']); // your domain name - not *.worldsecuresystems.com, but the domain you've chosen for your site _gaq.push(['_setAllowLinker', true]); _gaq.push(['_trackPageview']); _gaq.push(['_addTrans', "{tag_orderid}", // Order ID "", // Affiliation "{tag_amount}", // Total "", // Tax "", // Shipping "", // City "", // State "" // Country ]); _gaq.push(['_trackTrans']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); /script
You won't see all the details about the purchase in Google Analytics. That's because Business Catalyst does not pass all the needed variables to the order receipt page. [Perhaps that's a feature request.]
However, it's still valuable to know the order ID and revenue in Google Analytics - knowing which sources drive your revenue is critical. It's also pretty easy to grab the order ID [under Ecommerce > Transactions in Google Analytics] and look in your Business Catalyst site for the order. Here's a screenshot of the results I saw on the first day.
I love this article, J! Is it OK if a convert it to a document? Please post your site here so that I can link it on the bottom and give you a proper credit for it.
Thanks for sharing your knowledge with the community!
-m
Thanks. You can link to http://brockms.com/. But I'd want to make it a bit more thorough before you turn it into a document. Would that be something I send you in a message?
Yes. Please PM me once you're happy with it.
Cheers,
-mario
Fantastic - Thanks for your efforts brockms - was doing my head in.
How/Where do I access/open this page:
/Layouts/OnlineShop/order_receipt-US.html
Thanks!
You can either navigate in the BC backend:
Site Manager > Module Templates > Online Shop Layouts > Recipt - Buy
or through Dreamweaver
Root > Layouts > OnlineShop > order_receipt-US.html
Thank you!
Justin, thanks a lot for sharing.
You mentioned That's because Business Catalyst does not pass all the needed variables to the order receipt page
Would you please list what else BC should make available in order to make it possible to produce the desired GA reports? We will look at adding those.
And what are the reports you're usually looking at in GA for your BC sites?
Google Analytics could collect the following if Business Catalyst passed it to the order_receipt-US.html page.
These two articles should get Business Catalyst developers a long way toward enabling this
It would be nice if this were a simple site setting option in the admin console. I built a WordPress store once, for instance, that only required my Google Analytics profile id (the 'UA-*******-*' number). Once I entered it, analytics worked site wide and transactions showed up, too.
In Google Analytics, I look at a number of reports. I'll use the reports under the Advertising tab to evaluate my return on ad spend. I also use the reports under the Conversions tab to work backwards from purchases and completed goals to sources or site changes that impacted them.
Thanks Justin.
We're aiming to make GA fully work with BC as easily as providing your profile id, and the information you provided here helps us in this direction.
That's wonderful! Thank you and let me know if I can help in any other way.
Marius,
What's missing is the transactional data for each product.
We have to do a massive cookie workaround to pass each of the products purchased across so we can get a complete picture of the order processed. Not just the total.
Like Justin said, you've got access to google's dev code so it's pretty self explanatory what we need.
Justin, I'd like to get you a hand with this doco. I've got a few tips I can share.
For example if you put the {tag_amount} into a variable you can re-use it for things like event tracking.
Thanks Justin! You are a super star for sharing this. Just what I was looking for
Just wanted to check - I've only got the tracking code in the default template so do I paste the full code again in the Receipt-Buy section (even though it uses the default template) or is it ok to just at the below to the default template?
_gaq.push(['_addTrans', "{tag_orderid}", // Order ID
"", // Affiliation
"{tag_amount}", // Total
"", // Tax
"", // Shipping
"", // City
"", // State
"" // Country
]);
_gaq.push(['_trackTrans']);
Sorry if a silly question
This document was generated from the following discussion: How to set up Google Analytics Ecommerce Tracking for BC
Copy link to clipboard
Copied
Question: so is there no need to update the _setDomainName on the worldsecuresystems.com page(s)? I had assumed that on those worldsecuresystems.com pages the _setDomainName would have to be set to =worldsecuresystems.com. If setting it to the primary domain name "example.com" for all templates allows this to work in GA ecommerce, then great!
And thanks so much for sharing this.