I've been tasked with enabling Google Analytics ecommerce tracking on a client's website. I've read Google's documentation on the subject, but it made little reference to tracking conversion data, which is a feature that our client has asked for.
My question is this: on which page(s) do I need to add information regarding items/transactions? We have pages for shopping cart, payment info, confirmation, and receipt. The Google documentation only mentions putting this code on the receipt page, but I feel as though this wouldn't give us the information necessary to track conversions. Is Google Analytics able to track this information simply by virtue of having the general page tracking code on each page, or does transaction info need to be tracked across all of our checkout pages?
You only need the item/transaction tracking code (_addTrans(), _addItem(), & _trackTrans()) on one page, after the purchase has occurred -- in your case it sounds like the receipt page.
You do need to make sure that the general analytics code is on every page, including the checkout and receipt pages, otherwise you can lose the chain of tracking data leading up to the conversion.
Related
We are implementing a native analytics system and want to apply the same tracking principles Google Analytics uses. We've figured everything out but one thing:
Every time I refresh a page with an url that has utm-parameters attached to it, Google Analytics somehow figures out that it's not actually a visit but the same page that gets refreshed and shows only one visit in its dashboard from that particular source.
Is anybody aware how GA specifically does that so I can replicate it in our system?
I know that I can use
performance.navigation.type
in my JS script, but it doesn't give me desired results.
Any help would be much appreciated.
Attribution in GA happens on the Google servers, so JavaScript will be of limited use. Basically since a reload means that the user has the same client id and no change in the channel (source, medium and campaign are the same as in the previous visit) the existing session will be continued (a change of campaign/source information would trigger a new Google Analytics session).
Google has a very nice chart that explains how campaign information and traffic source information is processed.
On a website with affiliate links, where there is no programmatic access to the conversion logs, I treat it as offline conversions.
My Setup
Online
A user visit my website, see the affiliated ad and a promotion view hit is being sent.
When the user clicks the ad, a promotion click hit is being sent and the user is redirected to another page on my site.
On the "redirection page", an product view hit is being sent, and the user is being redirected to the affiliation link, passing his Google Analytics clientId.
Offline
Once a week I download the stats from the affiliate program, which looks something like:
clientId visits conversions revenue
4444444444.3333333333 1 0 $0
1234567890.1234567890 1 1 $16.40
Then I use the Measurement Protocol to send offline events:
For each line of visit, I send a product click hit.
For each line of conversion, I send a product purchase hit.
My Problem
The conversion shows up on the eCommerce report:
Because the offline hits are being sent after the original session is already closed, a new session is opened which doesn't contain the info about the user.
So I can't see the conversion on the demographic report, for example:
Optional Solution?
I'm thinking of using the user-id feature of Google Analytics.
Even though the users are not identified, I can identify them by their clientId.
Sure, this is not what Google intended when they introduced that feature, but I believe it will solve my issue. I'm just not sure about the negatives.
My Questions
Any feedback on my setup?
Why is it even necessary to pass the clientId after the session is closed? what kind of information is being shared between the real session and the offline hit?
Is it a bad idea to pass the clientId as a userId to Google Analytics? Why?
Relevant Articles
A Comprehensive Guide to Tracking Offline Interactions in Google Analytics using the Measurement Protocol
Google Universal Analytics isn’t Linking Offline and Online User Properly
We were able to link offline action through as you did with measurement protocol but the problem is that those sessions are not included in demographic and age report.
Rather looking those report I used them to do segmented analysis E.g. pages they have look at, sources they used to come also I used it with attribution model to understand best channels to drive more conversions.
Yes you can use CID as a user ID but I haven't tried it with offline tracking. Share the result with us.
A client of mine is having some issues with regards to tracking campaigns in Google Analytics that I was hoping one of you can advise me on.
They have recently sent out an email with the Google Analytics campaign information in the links back to the site from a button in the email (link created with the URL builder).
As well as the Google Analytics information they also send their own parameter for tracking using a bespoke system of theirs. In the end the url that visitors would go to after clicking the button in the email was something along these lines:
http://www.domain.com/pagename/?bespokecampaign=lead_gen/email/email_btn/boxcampaign&utm_source=email_pure&utm_medium=email&utm_term=email_btn&utm_campaign=boxcampaign
Looking at Acquisitions in the Google Analytics report I can see in the past this page has been viewed and has the correct Source/Medium set as email_pure/email.
However, there was a lead gen form that was filled out on the site after landing on this particular page that sends an event action that the form was filled out. When trying to view the campaign information for these events I do not see any information regarding the Source / Medium for that event being the correct information from the URL.
The Salesforce model in place to receive these leads took the referrer URL correctly, containing the Google Analytics parameters, but there was no record in Analytics to suggest one of the form events had the Source/Medium of email_pure/email.
Does anyone have any ideas on what could be causing this and potential fixes?
Basically, we use affiliate products. When we get a return call from their servers saying we have a sale, we want to send that information back into GA. Right now we can do that just by loading the page with ecommerce tracking and tacking on UTM parameters in the link based on the user who purchased...
One big thing we want to do though is actually send back the device information the user purchased with back to analytics. we capture it in our custom CRM, I'm just not sure how we can pass it back to analytics. using valuetrack parameters in the URL doesn't work, and i'm not sure how to modify the ecommerce code to figure this out.
Any help is appreciated!!!
I've set up GA ecommerce tracking by putting the required JavaScript code on my order receipt page. However, if the user reloads the page (or arrives to it without actually completing a purchase), won't the order be counted again?
How can I make sure each order is counted once and only once?
First off, your application should probably be designed in a manor that would not allow users to access an "Order Placed" type page directly, they should only be able to get there as a result of shopping cart checkout process. Depending on your server technology, you can usually limit this by only accepting specific HTTP Verbs (methods) such as only allowing POST operations.
Secondly, check out the addTrans()documentation. So if your application allows users to refresh a page that is tracking transactions, then logging the exact same ecommerce data for the same orderId will just overwrite the old data with the new data - which may be the same depending on how your app is structured.
Either way, I strongly recommend not allowing your users to refresh this page if you that is where you are tracking Google Analytics. When an order is placed on our website, we clear out the shopping cart and return the user to an order receipt page with the GA ecommerce tracking. Then, if anybody tried accessing that page again and their cart is empty, the get redirected to the "Orders" page where they can review recently placed orders (no GA ecommerce).
Hope this helps!