views:

21

answers:

1

Im promoting a website that has a simple "Download Now" button. When a user clicks this button, they receive a file (a firefox addon that installs in their browser).

I've created a number of different version of the addon to use with different marketing channels (AdWords, Facebook Ads, Yahoo, etc). Each version has a unique ID that is passed back to our server to track installs/stats.

What I would like to do is read the URL of the incoming visitor, which contains specific marketing campaign IDs, and then when the user presses Download Now, deliver the appropriate file to them based on the marketing channel in that URL.

So if a user hits our site with the url: www.oursite.com/?utm_campaign=google&keyword=blah we will deliver the "google" version of the addon.

Is there a way to accomplish this? We're running LAMP for the site.

+1  A: 

Create a page that looks at the utm_campain, and redirects the user to the appropriate download page.

switch($_SERVER['utm_campaign'])
{

   case 'google':
      header("Location: http://youservername.com/path/to/google_Download.xpi");
   break;
   case 'facebook':
      header("Location: http://youservername.com/path/to/facebook_Download.xpi");
   break;

}
Byron Whitlock