Google Analytics for mobile on PHP4

I was installing Google Analytics for mobile on several websites, when it occured to me that one was not tracking. After some source browsing followed by debugging, I saw that setrawcookie() failed. I forgot that this particular server was still running on PHP4. A quick look on php.net showed that setcookie() would do the trick too.

After making the change, while waiting for tracking to be enabled in the Analytics Dashboard, I looked up this issue and came across this very nice blog post. It supports my conclusion, which is always good to know.

Day 2

Assuming this would fix the issue, I let it be, until I saw the next day I still had no tracking. After some more debugging I noticed that file_get_contents() was having issues too. I removed the last two parameters, leaving only the URL, and uploaded the file for a new wait. After a couple of hours my 'no tracking installed' icon was gone.

Reason for posting is that sometimes you're just stuck with old systems. If you can, do upgrade to PHP5 instead of using this fix.