3

We use the Google Analytics Measurement Protocol to send offline transactions to Google Analytics. Sometimes we need to send two or more transaction with the same ID (and positive revenue). It works properly when we send transactions (with the same ID) in some days. However when we send two transactions (with the same ID) on interval of 1-2 minutes only one of them is considered in Analytics and another is ignored.

Is there any minimum interval between sending transaction with the same ID?

Code from comment:

$curl=curl_init(http://google-analytics.com/collect'); 
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true); 
curl_setopt($curl,CURLOPT_POSTFIELDS, 'v=1'.'&ni=1'.'&tid='.$track_id.'&cid='.$client_id . '&t=transaction'.'&ti='.$transaction_id.'&tr='.$revenue); 
curl_exec($curl);
curl_close($curl);
ksanto
  • 59
  • 4
  • Any chance you can come up with a simple script that can show this? Give me a couple of your requests so we can see the problem. – Linda Lawton - DaImTo Mar 29 '16 at 13:13
  • I have no idea and that's a good question, but since the minimum granularity in the GA reports is in minutes it might be that multiple transactions within the same minute are ignored. – Eike Pierstorff Mar 29 '16 at 13:13
  • 1
    @EikePierstorff I am wondering if its a session issue. Need to test this. agreed really good question – Linda Lawton - DaImTo Mar 29 '16 at 13:15
  • We use simple PHP code for sending: `code $curl=curl_init(http://google-analytics.com/debug/collect'); curl_setopt($curl,CURLOPT_RETURNTRANSFER,true); curl_setopt($curl,CURLOPT_POSTFIELDS, 'v=1'.'&ni=1'.'&tid='.$track_id.'&cid='.$client_id . $data); curl_exec($curl);` – ksanto Mar 29 '16 at 13:32
  • @Eike Pierstorff Transactions (with the same ID) were sent in different minutes. So the granularity constraint is satisfied. – ksanto Mar 29 '16 at 13:48
  • Um just wondering but you know that debug/collect wont actually send anything right? – Linda Lawton - DaImTo Mar 29 '16 at 13:59
  • Yes. It's just misprint. Really we use http://google-analytics.com/collect – ksanto Mar 29 '16 at 14:08

0 Answers0