A PHP library for reading a website visitor's referral source information (e.g. what ad campaign, keywords a user clicked to come to my website) from their Google Analytics cookie. Useful for saving this information when, for example, a new user signs up on your website, to later analyze your customer acquisition channels.
ReferralGrabber.php in your PHP code, and then call
$data = ReferralGrabber::parseGoogleCookie($_COOKIE['__utmz']);
$data array will be a map of the keys
gclid and their respective values.
Save all of these referrer parameters in your users table. See our blog post about building a killer marketing dashboard using this data at http://blog.rjmetrics.com/?p=855.
Thanks to Justin Cutroni for laying the groundwork for this code here http://cutroni.com/blog/2009/03/18/updated-integrating-google-analytics-with-a-crm/.
See LICENSE file for terms of using this library.
RJMetrics retains creative control, spin-off rights, and theme park approval for Mr. Referral Grabber, Baby Referral Grabber, and any other Referral Grabber family character that might eminate therefrom.