简体   繁体   中英

Server side analytics using PHP-GA does not show up in my GA account.

I have been trying to use php-ga library to send server side ga event but, some how the data is not showing up on GA, using the GA js it works but from the server side this is not working. After trying for 2 days I am posting here.

Sample code:

$page = new GoogleAnalytics\Page("/dummypage.php");
$page->getTitle("Dummy page");
$tracker->trackPageview($page, $session, $visitor);

The logs printed by php-ga seems fine:

Request: (Hiding the GA ID).

September 2, 2014, 10:14 pmGET /__utm.gif?utmwv=5.2.5&utmac=UA-XXXXXXXX-1&utmhn=somethingawesome.in&utms=2&utmn=135498032&utmcc=__utma%3D80555669.599680152.1409676286.1409676286.1409676286.1%3B&utmp=%2Fdummypage.php&utmcs=-&utmr=-&utmip=127.0.0.1&utmul=&utmfl=-&utmje=-&utmhid=1974089052 HTTP/1.0^M

Host: www.google-analytics.com^M

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36^M X-Forwarded-For: 127.0.0.1^M Connection: close^M

Response:

September 2, 2014, 10:14 pmResponse = HTTP/1.0 200 OK^M Pragma: no-cache^M Expires: Wed, 19 Apr 2000 11:43:00 GMT^M Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT^M X-Content-Type-Options: nosniff^M Content-Type: image/gif^M Date: Sat, 30 Aug 2014 00:53:10 GMT^M Server: Golfe2^M Content-Length: 35^M Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate^M Age: 316296^M Alternate-Protocol: 80:quic^M ^M

I am sure my GA ID is correct. Thanks, Mohan

实际上,我只是意识到它正在工作,只是奇怪的是事件没有显示在GA的实时信息中心中(但在常规视图中可用)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM