Analytics
2.4K members online now
2.4K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Transferring ClientID from _ga to Measurement Protocol

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi, 

 

I'm working on an Ecommerce Analytics implementation and wonder if transfer of the Client ID variable is done correctly. The format for Client ID looks different across various Google documentation and tools.

 

In debug mode my webshop can print the value of the _ga cookie. It consists of four decimal numbers separated by dots. By means of a ga ready callback function [1] I fetch a version of Client ID which consists of the two last decimal numbers of the _ga cookie separated by a dot. 

 

My page does a quick scramble of this and embeds it in a variable sent to PayPal. After a purchase, my IPN script extracts and descrambles the exact same string value for Client ID. This value is then sent to Enhanced Ecommerce with the parameter &cid=888888888.1111111111. The hit which I send uses &t=pageview and the correct &tid=UA-xxxxxxxx-y. The pageview shows up in Real Time, and after a day or so I can see something happening in the Ecommerce reports. But since I'm only testing for now, there is no real funnel in play. 

 

When I look up &cid in Enhanced Ecommerce documentation [2] and the Hit Builder its contents looks quite different from the _ga Client ID. Am I doing this correctly? 

 

 

Best regards, 

Borge

 

 

 

[1] https://developers.google.com/analytics/devguides/collection/analyticsjs/command-queue-reference?hl=...

[2] https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide

 

1 Expert replyverified_user

Re: Transferring ClientID from _ga to Measurement Protocol

Rising Star
# 2
Rising Star
Hi Borge,

The documentation provides just a sample. Your cid looks correct. We've done quite a lot of this with the measurement protocol and as long as you are harvesting it correctly and then passing it back in; your original attribution should be intact.

It's important to set up a good QA and pull all values before and after to make sure you get what you expect. In addition do some exception reporting for any measurement protocol hit that does not return a 200 status.


Best,
Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn