thanks for helping
I changed my request to post and added the cid parameter
my func looks like this now:
function getUuid() {
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
mt_rand( 0, 0xffff ),
mt_rand( 0, 0xffff ),
mt_rand( 0, 0xffff ),
mt_rand( 0, 0x0fff ) | 0x4000,
mt_rand( 0, 0x3fff ) | 0x8000,
mt_rand( 0, 0xffff ),
mt_rand( 0, 0xffff ),
mt_rand( 0, 0xffff )
);
$postdata = http_build_query($arr);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('
http://www.google-analytics.com/collect', false, $context);
file_put_contents("/var/www/***/glogs.txt", $postdata . "\r\n\r\n", FILE_APPEND);
file_put_contents("/var/www/***/glogs.txt", $result . "\r\n\r\n", FILE_APPEND);
file_put_contents("/var/www/***/glogs.txt",json_encode($http_response_header) . "\r\n\r\n",FILE_APPEND);
}
i logged everything in the txt file and i get 200 status code but i can't see any ecommerce tracking in my analytics panel
here is what my glogs.txt reports:
v=1&tid=UA-29822476-1&t=transaction&ti=79&tr=26.9&ts=7.9&tt=0&cid=78c6dc4a-65e3-4f5e-b13d-8f96525d062f
GIF89a �����, D ;
["HTTP\/1.0 200 OK","Date: Thu, 27 Dec 2012 11:29:46 GMT","Content-Length: 35","X-Content-Type-Options: nosniff","Pragma: no-cache","Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate","Expires: Mon, 07 Aug 1995 23:30:00 GMT","Last-Modified: Sun, 17 May 1998 03:00:00 GMT","Content-Type: image\/gif","Access-Control-Allow-Origin: *","Server: GFE\/2.0"]
v=1&tid=UA-29822476-1&t=transaction&ti=79&tr=26.9&ts=7.9&tt=0&cid=78c6dc4a-65e3-4f5e-b13d-8f96525d062f
GIF89a �����, D ;
["HTTP\/1.0 200 OK","Date: Thu, 27 Dec 2012 11:29:46 GMT","Content-Length: 35","X-Content-Type-Options: nosniff","Pragma: no-cache","Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate","Expires: Mon, 07 Aug 1995 23:30:00 GMT","Last-Modified: Sun, 17 May 1998 03:00:00 GMT","Content-Type: image\/gif","Access-Control-Allow-Origin: *","Server: GFE\/2.0"]