Web Referral Tracking For Morons
April 10, 2009 10:05 AM   Subscribe

Coding advice needed on how to create some basic user/referral tracking functionality on a website.

Please go easy on me as I'm not a developer, but I need to evaluate a request from my boss that came in urgently without consulting me. Answers understandable from a kindergarten level perspective will be appreciated.

I have a site running on Drupal. MySQL backend. Bunch of PHP handling communication between the two. My boss signed a revenue sharing deal wherein I need to track all users coming from the partner site for six months. If any of them buy anything either on first click through to our site or on any subsequent click through within six months, we give the partner precentage of the revenue. I need to be able to do this extremely quick and cheap...even if it's dirty. What's the best way to do this so that I can report on it out of the database or at least see all transactions for these users in a GUI?

Here's what I know he agreed to:
1. Banner on their site
2. Banner sends user directly into a Flash tool housed in a Drupal generated page
3. User registers AFTER performing functions in Flash..or..they go away and don't register..I still need to be able to track them if they come back and register later
4. After registration, user buys what they've made in Flash Tool
5. Every day I look at orders or some new GUI that shows me users who came from partner and how much they bought.
posted by spicynuts to Computers & Internet (5 answers total)
 
I don't know if there's an off-the-shelf module that will do what you need, but I made a more general-purpose tracking module a few months ago and most of what you're asking for is possible. A good Drupal dev would be able to put it together for you in a few days.

You'll need to turn on the access logs, then pull up all the records that hit your 'You Just Made A Purchase!' page. Those records will have the uid of all the users that made purchases. Now, search through your accesslog records for every one of those uids, and see which of them also hit the 'You Just Came From Our Partner' page (you'll want to make two pages with your flash tool; one copy that's generally available for customers that come to your site, and one that isn't linked from anywhere else. The isolated one is the copy that your referral partner will point customers towards).

The users don't need to register for you to do this. There are two problems I see: tracking users who don't register, leave, and come back (you'll need some cookie magic to make that happen) and associating a uid with a purchase. Your database may already have that information, but you might need to set up an extra table for it.
posted by tylermoody at 10:30 AM on April 10, 2009


Response by poster: Thanks, tylermoody..however, it's impossible for us to make two versions of the flash page. Trust me on that. It's just not possible. What about a very quick preliminary re-direct page prior to the Flash page? That way only the users from the partner hit that page and then are immediately redirected to Flash tool.

Database already associates a uid with a purchase as you are not allowed to purchase without an account. So I think I've got that covered.
posted by spicynuts at 10:39 AM on April 10, 2009


Personally I'd suggest using a cookie instead of trying to search through access logs. Cookies are how almost all referral tracking systems work. You give them a cookie when they hit your site that stores where they came from, and then when they register/login, you store that info in the database, associated with their account. From then on, it's simple to generate reports to see how many users registered / bought stuff, who came from the partner site.

Another problem with access logs is what if their IP address changes? And what if there are multiple users from the same IP?
posted by davr at 10:39 AM on April 10, 2009


A landing page that redirects to the flash page will work, you just need an isolated page that only referred users can reach.
posted by tylermoody at 10:45 AM on April 10, 2009


davr and tyler between them have the solution: link the banner to a page that just gives the user a cookie with a referer code and redirects to the Flash page. You can set the cookies to expire in six months since that's the referral deal's timeout. Then just tag registrations and purchases with the referer code from the cookie and you're all set.
posted by nicwolff at 2:31 PM on April 10, 2009


« Older Help me plan an international vacation for two....   |   Monitor shopping for my PS3 Newer »
This thread is closed to new comments.