Last active
October 4, 2017 16:47
-
-
Save underdown/1711750 to your computer and use it in GitHub Desktop.
twilio - analytics call tracking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//http://www.vdgraaf.info/google-analytics-without-javascript.html | |
header("content-type: text/xml"); | |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
$var_utmac='UA-45XXXX-1'; //enter the new urchin code | |
$var_utmhn='domain.com'; //enter your domain | |
$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=''; //referer url | |
$var_uservar='-'; //enter your own user defined variable | |
$var_utmp='/inboundcall/'.$_POST["To"]; //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'; | |
$ch = curl_init ($urchinUrl); | |
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); | |
$output = curl_exec ($ch); | |
?> | |
<!-- replace XXXXXXXXXX with your phone number --> | |
<Response> | |
<Dial>+1XXXXXXXXXX</Dial> | |
<Say>Our agents are busy right now. Please call back shortly. Goodbye.</Say> | |
</Response> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment