Home > Paid Traffic Sources > Mobile

Script To Redirect Mobile Traffic Via Carrier To Specfic Offers (16)


09-07-2011 07:05 PM #1 illusive (Member)
Script To Redirect Mobile Traffic Via Carrier To Specfic Offers

Can anyone point me in the direction of a script capable of doing the above as well as redirect via geo location and pass along the tracking variables from the mobile ad networks?

I'm trying to get one built, but everyone who has replied to my ad so far, doesnt seem to have clue how to it.

Heres what I posted it makes sense to me but maybe its only me because I don't usually request scripts to built for me!

"I want a PHP script that will take all traffic I am sending to a .php page from mobile traffic networks like admob, jumptap, adfonic etc. and determine which carrier the traffic is coming from (AT&T, Verizon, Sprint, etc).

I then want to be able to specify in the script the URL each carrier will be redirected to:

i.e.

Traffic from AT&T sent to www.mysite.com/att
Traffic from Verizon sent to www.mysite.com/verizon

etc...

As well as redirect by the country the traffic is coming from United States, United Kingdom, Austraila etc

I want a proven competent developer who is familiar with mobile networks like Admob, Jumptap etc that can write this script. As the script will need to be able to pass all the tracking parameters for the major mobile traffic networks I work with above and all other major mobile advertising networks."

So if any fellow stackers can help I would really appreciate it.


09-07-2011 07:38 PM #2 polarbacon (Moderator)

here is my advice on this....is there a better way you can do this?

Your asking alot to happen on a poor connection (mobile)......its 100% possible....but your asking a mobile connection 2 go thru prob at a min 3 redirects.....maybe 4 depending on the advertiser....

high potential for click loss....


09-07-2011 07:54 PM #3 The Angry Russian (Moderator)

Good luck I've tried to get something built but decided to keep it simple and went another route.

If you do get it build would be very interested in testing it.


09-07-2011 08:00 PM #4 diegoal (Member)

I don't understand why this would be complicated? If all of those networks have tracking parameters for carriers then it should be very easy to code.


09-07-2011 08:53 PM #5 bbrock32 (Administrator)

You should be able to do it using MaxMind's ISP database.

It won't be very accurate but that's the best you can get without using external paid services.


09-07-2011 09:05 PM #6 illusive (Member)

I wish their was an easier way polarbacon.

I thought you would have the answer I was looking for Angry Russian. Would you be so kind to share your work round man?

That's what I though diegoal but all of the coders are asking me for access to API's, IP & subnet addresses of each and every carrier and all sorts of other things that I haven't got fucking clue how to get! LOL


09-07-2011 09:10 PM #7 illusive (Member)

Hey Besmir could you elaborate on your suggestions?


09-07-2011 09:31 PM #8 tijn (Moderator)

http://www.handsetdetection.com


09-07-2011 09:50 PM #9 illusive (Member)

Hey Tijn, just signed up for the 14 day free trial...its seems to redirect mobile website visitors to mobile friendly pages but surely if they can do that they can do what I'm looking to do...I have to inspect it a bit closer.

Cheers


09-07-2011 09:54 PM #10 bbrock32 (Administrator)

Here ya go :

http://www.codereye.com/2010/12/mobi...ion-using.html


09-07-2011 10:19 PM #11 Mr Green (Administrator)

Lol I know what is going on here...


09-08-2011 01:34 AM #12 diegoal (Member)

Here's a start in case someone's interested. You'll have to define carriers and URLs. Pretty straightforward. Script can be modified and used for other purposes as well. The defined carriers are what $_GET['carrier'] will match against. So, if someone lands on your site with a URL that looks like this: domain.com/?carrier=nextel the word "nextel" will get matched against "sprintnextel." If it fails it will go on to "att", "tmobile", etc. In this case though there will be a match (since nextel exists in sprintnextel) and user will get redirected to http://nextel.com.

[PHP]<?php
// Define carriers and URLs.
// Use alphanumerical characters only and no white space.
// e.g. Virgin Mobile should be virginmobile and AT&T should be att.
// Also, use entire name of carrier.

$carriers = array();
$carriers['sprintnextel'] = 'http://nextel.com/';
$carriers['att'] = 'http://att.com';
$carriers['tmobile'] = 'http://tmobile.com/index.php?search=samsung';
$carriers['boost'] = 'http://boost.com';
$carriers['verizon'] = 'http://verizon.com';
$carriers['cellularsouth'] = 'http://cellularsouth.com';
$carriers['cellularone'] = 'http://cellularone.com';

// undefined carriers are sent to this url

$carriers['undefined'] = 'http://google.com/search?q=hurrdurr';

///////////////////////////////////////////////////////////////////
// SETUP STOPS HERE ///////////////////////////////////////////////
///////////////////////////////////////////////////////////////////

$query = http_build_query($_GET);

function verifyCarrier ($value) {

$value = urlencode(trim($value));
$value = preg_replace("/[^a-zA-Z0-9\s]/", "", $value);
global $carriers;

foreach ($carriers as $carrier => $carrierURL) {
$pattern = '/'.$value.'/i';

if (preg_match($pattern, $carrier)) {
$url = $carrierURL;
break;
}
}

if (empty($url)) {
$url = $carriers["undefined"];
return $url;
} else {
return $url;
}
}

function formatURL ($url) {

if (preg_match('/\?/', $url)) {
$separator = "&";
$slash = "";
} else {
$separator = "?";
$slash = "/";
}

return $slash.$separator;
}

// Now run everything

if (!empty($_GET['carrier'])) {

$carrier = $_GET['carrier'];
$url = rtrim(verifyCarrier($carrier), "/");
$separator = formatURL($url);
$url = $url.$separator.$query;
} else {
$url = $carriers['undefined'];
}

header('location:'.$url);
?>[/PHP]


09-08-2011 01:45 AM #13 The Angry Russian (Moderator)

Awesome, goddamn I wish I knew how to code myself, alas

...if any of you coders are interested hit me up, I'm trying to develop a mobile tracker. Got something very rough going but it integrates the Macros from some of the networks and redirects a lot faster than 202 making it ideal for mobile.

Stay Angry My Friends


09-08-2011 10:05 PM #14 diegoal (Member)

Script updated to pass all variables to defined URLs.

@ Angry Russian

Might be interested in helping you out with that. Hit me up if it's not too time consuming


09-09-2011 12:08 AM #15 leeches (Member)

So you would use this script as a way to send users a particular offer based on which carrier they are coming from. This way you can target all users on all carriers in one swoop and let the script send them to the correct carrier offer?


09-09-2011 06:34 PM #16 diegoal (Member)

Quote Originally Posted by leeches View Post
So you would use this script as a way to send users a particular offer based on which carrier they are coming from. This way you can target all users on all carriers in one swoop and let the script send them to the correct carrier offer?
Yes.

Remember, this script only works if the ad network supports tracking tokens for carriers (JumpTap).


Home > Paid Traffic Sources > Mobile