php Google Analytics RSS Feed跟踪

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Google Analytics RSS Feed跟踪相关的知识,希望对你有一定的参考价值。

$var_utmac='UA-########-#'; //enter the new urchin code
$var_utmhn='http://example.com/rss.php'; //enter your rss url
$var_utmn=rand(1000000000,9999999999);//random request number
$var_cookie=rand(10000000,99999999);//random cookie number
$var_random=rand(1000000000,2147483647); //number under 2147483647
$var_today=time(); //today
$var_referer=$_SERVER['HTTP_REFERER']; //referer url

$var_uservar='-'; //enter your own user defined variable
$var_utmp='/rss'.$_SERVER['REMOTE_ADDR']; //this example adds a fake page request to the (fake) rss directory (the viewer IP to check for absolute unique RSS readers)

$urchinUrl='http://www.google-analytics.com/__utm.gif?utmwv=1&utmn='.$var_utmn.'&utmsr=-&utmsc=-&utmul=-&utmje=0&utmfl=-&utmdt=-&utmhn='.$var_utmhn.'&utmr='.$var_referer.'&utmp='.$var_utmp.'&utmac='.$var_utmac.'&utmcc=__utma%3D'.$var_cookie.'.'.$var_random.'.'.$var_today.'.'.$var_today.'.'.$var_today.'.2%3B%2B__utmb%3D'.$var_cookie.'%3B%2B__utmc%3D'.$var_cookie.'%3B%2B__utmz%3D'.$var_cookie.'.'.$var_today.'.2.2.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B__utmv%3D'.$var_cookie.'.'.$var_uservar.'%3B';

$handle = fopen ($urchinUrl, "r");
$test = fgets($handle);
fclose($handle);

以上是关于php Google Analytics RSS Feed跟踪的主要内容,如果未能解决你的问题,请参考以下文章

Google Analytics PHP示例

PHP Google Analytics PHP示例

php Processwire Google Analytics跟踪

php 将Google Analytics添加到页面

PHP 没有Javascript的Google Analytics

PHP 针对WordPress优化的Google Analytics