Analytics
5.3K members online now
5.3K 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

Measurement protocol/enhanced ecommerce

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I've set up enhanced ecommerce, we're trying to track transactions from our server as they may not relate 1:1 to website actions (it's a subscription service). So we're sending a payload to measurement protocol (which I've validated using the online Hit Builder) but not getting any response on Google Analytics. Here's our payload:

 

v=1&t=event&tid=UA-XXXXXXXX-Y&cid=555&uid=555&ec=Ecommerce&ea=Purchase&ti=555&cu=USD&pr1pr=8.99&tcc=555&ni=1&p=Purchase&pr1nm=Membership

 

Where 555 is some numerical string.

 

Is it OK? Have we made a mistake somewhere? Do you have any other ideas about what could be wrong? Thanks!

1 Expert replyverified_user

Re: Measurement protocol/enhanced ecommerce

Top Contributor
# 2
Top Contributor
Quite a few things are not kosher there:
- cid and uid are your client and user ID respectively. Those IDs need to be unique per user.
- ti is your transaction ID so I doubt this is going to have a value of 555 as well
- tcc is your coupon code, see above for 555 .
- p should be pa and Purchase be lower case
- You have no items in your transaction.
- This might be one of the few cases where you don't need to set event non-interaction (ni) ;-)

I'm afraid you'll have to study a bit more :-)
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Measurement protocol/enhanced ecommerce

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Julien, thanks for that. I obviously do need to study more!

I can see how to make an item in ecommerce, but not enhanced ecommerce, is it the same fields? I guess using a product name and price as I've done is not enough, but what are the necessary fields? Sorry to ask more questions, but it's not clear to me from the documents (it says they are all optional).

The 555's are all just an example string to make my typing easier and would be different numbers in an actual hit, I promise I've not tried to set every value to 555. Smiley Happy

Re: Measurement protocol/enhanced ecommerce

Top Contributor
# 4
Top Contributor
If you want to train on how measurement protocol URLs look like, try implementing page tags and look for /collect calls being made by the page. Those will show the exact parameters sent to GA using the MP.

Start here:
https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce
Then work your way to:
https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#enhanced-ec...
(which includes both the variable and the MP field
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan