Analytics
4.6K members online now
4.6K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Measurement Protocol not working

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

 I try to send http request to track eCommerce, i got response with http_code=200 but i cant see any event or transaction.
my code:
$fields_string = '';
$fields = array(
'v' => 1,
'tid' => "UA-xxxxxx-1",
'cid' => $userid,
't' => 'transaction',
'ti' => $transaction_id,
'tr' => $Transaction_revenue,
'ts' => $Transaction_shipping,
'tt' => $tax,
'cu' =>'EUR'
);
curl_exec($ch);
$information = curl_getinfo($ch);
foreach ($fields as $key => $value) {
$fields_string .= $key . '=' . $value . '&';
}
rtrim($fields_string, '&');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.google-analytics.com/collect");
curl_setopt($ch,CURLOPT_HEADER,true);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields);

 

or my hit:

v=1&t=event&tid=UA-xxxxxxx-1&cid=555&uid=123&ti=21&tr=20&tt=5&ts=2&pa=purchase&ec=Checkout&ea=Purchase
what could be the problem?

thanks a lot.

1 Expert replyverified_user

Re: Measurement Protocol not working

Top Contributor
# 2
Top Contributor
Hi,

Hit builder says that the hit is valid, you can check too: https://ga-dev-tools.appspot.com/hit-builder/

There is a delay in processing in GA, you may need to wait a few hours before the data shows up.

Hope this helps.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Measurement Protocol not working

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
I have check it and i start to send request 3 days ago and still nothing (not in the real time reports and not in the E-commerce reports).

Re: Measurement Protocol not working

Top Contributor
# 4
Top Contributor
I sent the hit to a test property and it appeared in real time and in ecommerce reports. Is the event recorded under Behavior -> Events? Do you have enhanced ecommerce enabled?

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Measurement Protocol not working

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Yes,I have enabled enhanced ecommerce .
and no, i cant see the records under Behavior -> Events too.

Re: Measurement Protocol not working

Top Contributor
# 6
Top Contributor
Did the event that you sent from hit builder appear in Google Analytics?

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Measurement Protocol not working

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Apparently it was an IP issue, thanks a lot.

Re: Measurement Protocol not working

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
Hi Inbal,

What kind of IP issue? And what did you do to fix it I'm having a similar issue.

Best regards
Lyndon

Re: Measurement Protocol not working

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭
I cloud not send transaction because my office IP was blocked.

Measurement Protocol not working

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

I had exactly the same issue. To elaborate:

 

A filter had been set up in Admin > All Filters to exclude all traffic from my home IP address. This exclude all traffic from the Hit Builder and also any test requests I sent from my browser.