I have started using Shaun Inman’s fabulous Mint stats package for about a month and half. It’s a great app. One of the really cool things about Mint is Pepper, Mint’s plugin API. There is an emerging Pepper plugin community out there. One Pepper that intrigued me was Outclicks by Andrew Sutherland. It works fantastic for any site that is on the main domain of the Mint install.
A problem with it is it does not work on sites reporting to Mint from a subdomain, like mine. The reason for this is Outclicks uses the XMLHTTPRequest object. In Internet Explorer and Firefox<1.5 the XMLHTTPRequest object can not call a page across subdomains. Well never one to let a problem hold me down I created a work around. My work around uses a PHP proxy file placed in the subdomain. The proxy file uses CURL to call the data.php file of the Outclicks Pepper which avoids the XMLHTTPRequest object problem. The other modification is in the Outclicks script.php file to point at the proxy file. Now I suppose I could have just put CURL in the script.php file but I wanted to preserve as much of the Outclicks file as possible. This is not an endorsed solution by Andrew and will likely break or be broken by any future Outclicks release. Download a .zip containing the files.
- Download the outclickshack.zip file and uncompress
- Open the proxy.php file and modify line ten to point at your Mint install
- Upload the proxy.php file to the subdomain you want to start tracking
- Upload the script.php file to the /mint/pepper/andrewsutherland/outclicks/ folder replacing the file already there
- Your finished!
If you have any problems please feel free to contact me through comments.