0
votes

I am using the Google Measurement protocol to send successful transactions from delayed payments to the analytics server. Everything works fine except for the product information that just wont show up in Google Analytics.

I have already checked if Advanced e-commerce is enabled in Analytics and tried several basic examples from the site, but nothing sticks. I used the following string (UA-ID is fake for obvious reasons.):

v=1&t=transaction&tid=UA-12345678-1&cid=b499f0c3-792c-4e4f-a717-d2a85ac55504&ti=250303&tr=105&tt=10&ts=5&cu=EUR&ds=web&pr1id=testsku&pr1nm=test%20product%20description&pr1ca=hardware&pr1pr=100&pr1qt=1

The measurement protocol hit builder says its a valid request, and the transaction also shows up in GA, but the actual products are missing:

enter image description here I have already contacted Google Analytics support, but they had no idea :).

3
How long did you wait? Remember it takes 24 - 48 hours for data to show up in the standard reports.DaImTo
@DaImTo Results usual show up after 20 minutes, but also results from a week ago don't show product data.Dennis van Schaik

3 Answers

1
votes

I figured it out after all. The problem is that you need to set the Product Action for it to work. If you dont set this parameter, all product data will be ignored. You can set this to detail, click, add, remove, checkout, checkout_option, purchase or refund.

Working example:

v=1&t=transaction&tid=UA-12345678-1&cid=b499f0c3-792c-4e4f-a717-d2a85ac55504&ti=250303&tr=105&tt=10&ts=5&cu=EUR&ds=web&pr1id=testsku&pr1nm=test%20product%20description&pr1ca=hardware&pr1pr=100&pr1qt=1&pa=purchase

To bad Google did not check for this in there Hit builder. that would have saved me a lot of time.

0
votes

Are you sending TRANSACTION and ITEM hits separately? Item hit need to be sent separately

To send ecommerce data, send one transaction hit to represent an entire transaction, then send an item hit for each item in the transaction. The transaction ID ti links all the hits together to represent the entire purchase. https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#ecom

0
votes

I was having the same problem even when setting the 'Product Action' ('pa') parameter to 'purchase' when using a 'transaction' hit type --> the transaction-level data was there, but the product level data was being ignored.

There's a notice in this documentation from Google saying: Important: Enhanced Ecommerce parameters must be sent with an existing hit (e.g. pageview, event), but cannot be sent with the Ecommerce transaction or item hit types.

It works fine if you change the hit type to 'pageview', but this means you have to provide a 'Document Path' ('dp'). This example worked for me:

v=1&t=pageview&tid=UA-12345678-1&cid=25222263-b5ca-410c-b4bb-6a621aa3b405&ni=1&dp=%2Ftest-pagePath&ti=12345&tr=10&tt=1&ts=2&pr1id=testsku&pr1nm=testProduct&pr1ca=testCategory&pr1pr=7&pr1qt=1&pa=purchase