2

I am looking at the documentation: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#enhanced-ecomm Anyone knows a link that explains with sample code how we can use the Enhanced Ecommerce with Measurement Protocol with multiple products in the same transaction?

I am posting the following to https://ssl.google-analytics.com/collect

[
'v'       => 1,
'tid'     => 'UA-52479722-1',
'cid'     => '555',
't'       => 'transaction',
'ti'      => '9998',
'tr'      => '100',
'tt'      => '10',
'cu'      => 'AUD',
'pa'      => 'purchase',
'pr[1]id' => '1',
'pr[1]nm' => 'Test Product',
'pr[1]ca' => 'Test Category',
'pr[1]qt' => '2',
'pr[1]pr' => '100'

]

I can see the transaction appear in my google analytics report, but no products.

Pawka
  • 2,526
  • 3
  • 25
  • 32
Liam
  • 415
  • 1
  • 6
  • 11

1 Answers1

7

Eventually, I solve my own problem. The format should be

pr1id:P12345
pr1nm:Android Warhol T-Shirt
pr1ca:Apparel
pr1br:Google
pr1va:black
pr1pr:29.20
pr1cc:APPARELSALE
pr1qt:1
pr2id:P12346
pr2nm:Android Warhol T-Shirt 2
pr2ca:Apparel
pr2br:Google
pr2va:black
pr2pr:29.20
pr2cc:APPARELSALE
pr2qt:1
Liam
  • 415
  • 1
  • 6
  • 11