Home > Tracking Campaigns > CPV Lab Pro

Setting Up Geo Redirect With CPV Lab (6)


09-25-2013 07:41 PM #1 egan (Member)
Setting Up Geo Redirect With CPV Lab

I've been trying to figure out how to set this up for the past day and can't seem to wrap my mind around it. My path looks like this :

Click image for larger version. 

Name:	Campaign_Path.jpg 
Views:	62 
Size:	23.5 KB 
ID:	1336

Not 100% sure this is the best way to do it to start. The three landing pages I'm using are all the same, but I want to track their performance on a country by country basis and have offers specific for those countries on them.

For each country I want to rotate two offers for the 30+ users and send the rest to a random webcam offer. I have the script in place for this on each of my landers.

I think I might have over reached with my first campaign on CPV Lab and am not sure if this is doable.

How do you guys generally set up geo redirect campaigns like this in CPV lab?


09-26-2013 06:35 PM #2 JasperP (Member)

I'm not sure which geo-redirect script you're using, but you can create several campaigns for each GEO and then use the appropriate campaign URL for each. It would be something like this:

Campaign #1: Spain
Campaign #2: Mexico
Campaign #3: Argentina
Campaign #4: All other Traffic

ad --> geo_redirect.php --> ES --> Campaign #1
ad --> geo_redirect.php --> MX --> Campaign #2
ad --> geo_redirect.php --> ES --> Campaign #3

Searching through the forums.. check out this geo-redirect script for ideas:
http://stmforum.com/forum/showthread...ll=1#post89834


09-26-2013 07:26 PM #3 egan (Member)

Awesome Jasper!

For the example above would I have four distinct campaign URL's for each of the campaigns? How would I work this as I can only have one ad served to all the countries on my placement for Juicy?

Probably something stupid I'm missing but can't seem to wrap my head around this whole thing.


09-26-2013 08:04 PM #4 JasperP (Member)

yeah you would have 4 distinct campaign URLs.

Here's some sample code that I edited. This is untested so let me know if it doesn't work:

Code:
<?php

/**
 * Title: Geo-redirect script
 * File Name: geo_redirect.php
 * Example Destination URL: http://mywebsite.com/geo_redirect.php?site_id=123&placement_id=123&keyword=300x250_ad1
 * Notes: site_id, placement_id, and keyword will be passed as the query_string to your campaign urls
 */

// This will pass any variables attached to the geo_redirect.php URL (See above example):
$query_string = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : "";

$geo = geoip_record_by_name($_SERVER['REMOTE_ADDR']);
$countrycode = $geo['country_code'];

switch ($countrycode) {
    // Spain Campaign
    case 'ES':
        $campaign_url = 'http://cpvlabtracker.com/base.php?c=111&key=fe413ba9a944b9dc635d7';
        break;
    
    // Mexico Campaign
    case 'MX':
        $campaign_url = 'http://cpvlabtracker.com/base.php?c=222&key=fe413ba9a944b9dc635d7';
        break;
    
    // Argentina Campaign
    case 'AR':
        $campaign_url = 'http://cpvlabtracker.com/base.php?c=333&key=fe413ba9a944b9dc635d7';
        break;

    // This is for "All Other Traffic"
    default:
        $campaign_url = 'http://cpvlabtracker.com/base.php?c=444&key=fe413ba9a944b9dc635d7';
        break;
}

header("Location: " . $campaign_url . "&" . $query_string);


?>
I edited the campaign numbers above. That might've been confusing.. it should be like this:
ad --> geo_redirect.php --> ES --> Campaign #1
ad --> geo_redirect.php --> MX --> Campaign #2
ad --> geo_redirect.php --> ES --> Campaign #3


09-26-2013 08:20 PM #5 egan (Member)

Ahhh, lightbulb just went on. I didn't know I could attach the variable to my geo redirect like that.

So, for example, if my campaign is on juicy ads, top right square placement, ad #1 my destination URL set up would be:

http://mywebsite.com/geo_redirect.ph...rd=300x250_ad1

and if I had other ads on that same placement I would just change keyword to 300x250_ad2 or xxx_ad3 etc?


09-26-2013 08:35 PM #6 JasperP (Member)

yeah you got it.

Also, in my example, I'm passing site_id and placement_id (completely optional). Those would need to be added as your extra tokens in CPVLab for EACH campaign. They're also case-sensitive too fyi.


Home > Tracking Campaigns > CPV Lab Pro