Returning transaction information from a confirmation page?

14 views
Skip to first unread message

devp...@gmail.com

unread,
Sep 28, 2015, 3:53:25 PM9/28/15
to Google Analytics Management API
Hi,

I've been reading up on how to return transaction information once a user checks out and reaches the confirmation page. For example, I would like to receive the time/date, order total, and product information along with the *campaign* info, using the user's cookies possibly to see what campaigns are being used and which ones aren't.

So far, I've found a couple methods that are close to what I want to do. But between all the different documentation and deprecated methods, I'm a little overwhelmed.

I think the best way for me to go about this is just grab a custom variable from the URL or from the cookie once the user reaches the confirmation page.

Is this so? And how do I actually go about this.. and please, if you link to Google documentation, can you explain it in a simpler way for me?

Matthew Cohoon

unread,
Sep 28, 2015, 5:14:48 PM9/28/15
to Google Analytics Management API
Is your issue with setting the information on the Google Analytics tracker? Or is it actually determining what information to set on the tracker?
Or is the issue with getting information from the Google Analytics tracker or the Core Reporting API? 

 The GA tracker gets/sets the campaign information at the session level when the user initially arrives at your property, from the utm_* url parameters. The date/time of the event is determined by when you send the event to Google Analytics.

How you retrieve the transaction information to set it on the tracker is dependent on the ecommerce platform you use.
Is the problem that your users arrive at your confirmation page with out any of the transaction information, no transaction id in the in url parameter?

If you are simply trying figure out the current state of a field is on the tracker you get use the get method:

ga('create', 'UA-XXXXX-Y', 'auto');

ga
(function(tracker) {
 
// Logs the campaign name.
  console
.log(tracker.get('campaignName'));

 
// Logs the campaign source.
  console
.log(tracker.get('campaignSource'));

 
// Logs the campaign medium.
  console
.log(tracker.get('campaignMedium'));
});

-Matt



--
You received this message because you are subscribed to the Google Groups "Google Analytics Management API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-mana...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages