Hey, everyone! Welcome back to this introduction series for the new Stack That Money Mobile Tracker v3/4.
This week we're looking at one of the coolest and most requested features of the tracker - the ability to easily set up redirects for location, mobile device, OS, carrier and more, with no coding required. Just select a few fields, and users will automatically be redirected to the right landing page, offer or URL depending on where they are or what they're browsing with.
Get The STM Mobile Tracker V4 here.
Other STM Mobile Tracker Tutorials


Example Rules
Here are a couple of example redirects that should show how the system works!
UK/DE Redirect
This will redirect UK users to one location, German users to another location, and everyone else to a third location.

UK Phones Redirect
This will redirect UK iPhone users to one location, UK Android users to another location, all other UK users to a third location and everyone else to a fourth location.

Common Carriers, OSes, Models and Brands
Pulled straight from the still-beating heart of my mobile Follow-Along campaign, here are some of the more common identifiers you'll use in redirects.
Common Carriers
Comcast Cable
Verizon Wireless
Road Runner
AT&T U-verse
AT&T Wireless
Sprint PCS
T-Mobile USA
Verizon FiOS
Cox Communications
Opera Software ASA
Charter Communications
AT&T Internet Services
Optimum Online
Level 3 Communications
CenturyLink
Wangsu Science and Technology (US)
Verizon Internet Services
MetroPCS Wireless
BellSouth.net
Cricket Communications
Opera Mini Proxies
Embarq Corporation
Common Brands
Apple
Samsung
HTC
LG
Nokia
Opera
Motorola
[No Brand]
Acer
Google
ZTE
Huawei
RIM
Coolpad
Amazon
Kyocera
Generic
SonyEricsson
generic web browser
Barnes and Noble
T-Mobile
Common Models
Obviously, this will rapidly change over time!
iPhone
iPod Touch
Mini 7
GT-I9300
SGH-I727
SPH-D710
[No Model]
A210
LG855
Lumia 820
001HT
9292
Nexus 4
SGH-T989
Mini 5
Android
Inspire 4G
MS770
D01400
Nexus S
Common OSes
iPhone OS
Android
[No OS]
Windows Phone OS
RIM OS
Symbian OS
webOS
Windows Mobile OS
Windows RT
Palm OS
Linux Smartphone OS
Man, awesome tutorials caurmen. I appreciate all the work you're putting into this. I've got a couple of probably stupid questions for you, but just wanted to clarify them.
In the UK Phones Redirect example above, I'm assuming it follows the logical path of evaluating the first expression, then the second, etc. where the user is redirected the first instance an expression returns true. So if the user meets the criteria for both #1 and #2 (for whatever reason), they are redirected the #1. Is that right?
Is the Passing Device Info option where you would include dynamic variables from the traffic source, assuming they are available?
@w3061 - Thanks! Glad you're finding them useful!
Passing Device Info: you'd include dynamic variables under the Tracking Variables section (c1 through c8). So, for example, if you were doing POF, you'd use {age:} as Tracking ID C1, {state:} as Tracking ID C2, and so forth.
Evaluation order: let me just go check the code to be sure ... elevator music ... OK, back.
Rules are evaluated in the order that they were entered into the database - oldest first - NOT first listed first. However, I'd strongly recommend that you don't use overlapping rules - it'll make debugging your rules setup a lot easier.
(bbrock32, feel free to correct me if I'm wrong on that one!)
Hi caurmen,
Do you know how can I fix that annyoing error?

Cannot use the new link too, it spits an error about the geoip.inc
Thanks
@Sarsap - Aha, right, a few people have had this problem. Open /202-config/setup-config.php file, and on lines 105-106, change
'/usr/local/share/GeoIP/GeoIPOrg.dat'
$_SERVER['DOCUMENT_ROOT'].'/3rd-parties/GeoIP/'
Hi caurmen,
Editing the setup-config.php didn't work for me, but I found another solution based on your code
I edited the checkdata.php line 45 from:
$dirs = array($_SERVER['DOCUMENT_ROOT'] . '/3rd-parties/geoip/', '/usr/local/share/GeoIP/');
$dirs = array($_SERVER['DOCUMENT_ROOT'] . '/3rd-parties/geoip/', $_SERVER['DOCUMENT_ROOT'].'/3rd-parties/geoip/');
$geoOrgFile = '/usr/local/share/GeoIP/GeoIPOrg.dat'; $geoCountryFile = '/usr/local/share/GeoIP/GeoIP.dat';
$geoOrgFile = $_SERVER['DOCUMENT_ROOT'].'/3rd-parties/geoip/GeoIPOrg.dat'; $geoCountryFile = $_SERVER['DOCUMENT_ROOT'].'/3rd-parties/geoip/GeoIPCountry.dat';
Nice work there! I'm sure that'll be useful for other people hitting the same issue.
Glad it's all up and running.
I'm confused by the Passing Device Info part. Is this only for circumstances where dynamic tokens are available from the traffic source? What do you need to do to support these parameters and how do you access them from your lander? Are they in the URL? In the database? Are the variable names explicitly named "carrier, brand, os and model?"
$carrier=@$_GET['carrier']
<? echo $carrier ?>
I've pretty much only used CPVLab so please forgive the basic question - What is the best way to analyze the carrier/os/etc conversion data on this interface? The only place i'm finding a call out for these is under overview > group overview. Is there anywhere else I should be looking? Thanks 
~Ian
Hey Caurmen, cheers for the tutorials!
Just a couple of questions, what is the best way to make a rule that will redirect to a rotating lander (while keeping c1-c8 variables etc.)?
With the geo redirects, it works if I redirect to a custom URL. If I set it to redirect to a simple landing page it doesn't work for me, it goes to: trackingdomain.com/tracking202/redirect/tracker.php?t202id=&t202kw=
Any help would be appreciated!
Hmm, that's odd.
I'll need to test and reproduce this. Can you list ALL the steps you go through to set up your geo redirect with a simple LP?
I'll follow them through and figure out what's going on.
Where do we get the country names to use in our redirects? For example, I'm not sure if I should put in United States, USA, or United States of America for a redirect. I'm clicking all through the reports but can't seem to find where that data would be.
Yup, that's correct - follow the naming conventions in the document w3061 listed.
@kyuss - have you tried clearing your memcache? Either wait 5-10 minutes or use Flush All - tutorial here: http://www.cyberciti.biz/faq/linux-u...ched-instance/
That's often the problem behind these sorts of issues. It can look hella wierd if memcache is still holding half the data for old rules.
Hi caurmen
I have got this message once I purchase.
Thanks for your order with MaxMind. For licensing purposes, we ask for information on where the database will be deployed. Please send us the following:
1. Established website where you plan to deploy the database or web service
2. Email based with that website
3. How you plan to use the database or web service
If we are unable to process the order, your credit card will not be charged.
Should I just inform them to deploy on the domain where I got the prosper installed ?
That's new! They didn't do that when I purchased the database.
Did you definitely purchase the "GeoIP Organization" database? It might be that you accidentally bought one of their bigger-ticket products.
Failing that, I'd get in touch with them and explain that you're deploying on a new website, and you'd prefer not to reveal too much information, and see what they say.
Let us know how you get on, this might be rather important! Thanks for posting about it.
Thanks for the great tutorial @caurmen
Lol caurmen
This is wat I get after tat...
" Do you have another established website with an email that you could utilize for processing this order? "
Actually these max mind ppl don really appeared to be friendly. Here's wat I got at the end
"On our shopping cart, it says:
"We require an email associated with an established website in order to process the order."
https://www.maxmind.com/en/cart
It would make it much easier if we had an email with established website to process the order. How are you using the database?
If you prefer to not provide this information, we could cancel the order, no problem."
Anyway..since I have to rely on STM mobile tracker which rely on their database...wat to do...
I have created my email..but really no idea how to tell them how I plan to use the database.
^^ Just tell them you need to use to detect carriers on your website
Shud I give him my lp domain email or prosper tracking domain email? Since they brought up licensing issue...jus worry if they say its only for certain website..n has to be deploy on the same...
Can you not say it's for detection of carrier during data logging in a private non-commercial click tracking system. It is not being deployed on a website providing content to internet users.
Surely that would suffice as an explanation. As for email, lol use a gmail address, gmail.com is a well established and reputable website.
Hi Zeno
Actually i am still struggling on the way to reply on "how you plan to use the database", the only reason is if they come out with follow up question, i am afraid that i couldn't answer d lol
Also, as for email, i did offer my gmail and they have actually insisted on having email from my established website or they can cancel my order lol
Easiest way to get yourself an "established website" for this purpose would probably be to get a cheap hosting package with Wordpress. Shared hosting will be fine, Bluehost or something is probably perfect. Get a domain at the same time.
Stick a free "business" theme on it - Google can give you hundreds of options - change the header graphic and fill in some very basic contact details. Voila - one reasonably professional-looking site for $14 and half an hour's work.
You can then use that for, as Zeno says, getting into affiliate networks, and also for getting MaxMind to get their nose out of your business 
Hey Kyuss, did find a workaround for this issue? I'm having the same problem when using redirects to landing pages..
I mean, yeah I gotta generate a new link if I change the rules. But I already submitted some banners with the old link.
Is this a normal process or a bug maybe?
@cosmeivan - Try flushing your Memcache after you add the rotating lander to your rule. Either use http://www.cyberciti.biz/faq/linux-u...ched-instance/ or just wait 10 minutes and see if it works then.
Let me know if that works - if not, we'll figure out what's going on and fix it.
Sure Caurmen, I waited about an hour for the Cache to get cleared. But the issues persist. The thing is I set a Redirect rule for Android (OS), so Android users would go to a landing page from camp1.
Everything else would go to Lander2 from Camp2.
When I tried the first time, it worked fine with my Android phone, and on Web it redirected to the default lander I set. But when I changed the rules to point to another landers. The old generated link only worked for the default redirect, when I try with Android it just doesn't work.
On the other hand, if I generate a new link for the redirect rule, it works just fine. So, I take it I won't be able to change the rules after I upload my banners to the traffic source?
Let me look into that and get back to you.
Any help with redirect appreciated here.. The tracker works for normal linking to a lander, and collecting all the geo and carrier data etc..
But I tried to set up a redirect rule based on operating systems.. and when I take the link it gives you (set up from right of the redirect rules page,in the "test it" box) I get this error..
Warning: fopen(/usr/local/share/GeoIP/GeoIP.dat): failed to open stream: No such file or directory in /home/surf/public_html/3rd-parties/geoip/geoip.inc on line 385
Can not open /usr/local/share/GeoIP/GeoIP.dat
I looked at what seems a similar issue on the first page of this thread.. But not sure if that is same issue or not?
Aha, this problem!
Copy GeoIP.dat from the 3rd-parties directory to /usr/local/share/GeoIP on your machine. It should work then.
I don't have a GeoIP.dat? only an GeoIPOrg.dat and GeoIPCountry.dat
http://prntscr.com/2bkpiu
Ah.. I'm giving up.. I renamed it, then it said it couldn't find the GeoIPCountry.dat
So I added both file names into folder.. now it redirects.. but not to my landers.. just to the fall back link.. Tried with my android mobile, and it's not having it.
I will just try creating seperate campaigns for each device type.. pain..
Thanks anyway..
If I could thanks you 100 times I would. Thanks so much kyle for helping me out!
I've added a rotating LP item, adding 3 LPs into a new "#10 Get Rotating Lander" item called "Rotating 001".
Is it possible to add a Geo-redirect rule that redirects toward this "Rotating 001" instead of just one single LP ?
Excuse me if this has been asked before, but I didn't find an answer.
I am reasonably certain that it is possible to do that, yes.
I have a question about the MaxMind DB we added to our server in order to get the geo-redirect rules working: can I use this DB to show other info to the user ? (not saying exact city but a least region?). What's the best solution to show on a Landing page the visitors' area/region name ?
Nope you need another DB for that.
It's called GeoIPCity , can buy directly from the same site.
Hey Caurmen, I'm not sure if it has been answered sorry for asking again 
Is it possible, instead of choosing a single LP, to choose a rotating lander in addition to a redirect rule?
Thank you very much for your answer 
@Julien - Yep, that should work fine.
Thank you, but how do you set it up technically?
Because under the tab #9 Redirects, I don't see the rotating landers created at step10 in the <select> elements.
I dont' find them, neither in Landing Page, nor in Campaign, nor in Direct Link (URL).
Oh, I was trying to sort this out and I was just wondering:
To make geo redirect working with rotating landers, maybe I can try to:
1/ setup a rotating lander on tab #10 Get Rotating Lander
2/ get the link of the rotating lander then
3/ and put this link in in the field "Direct Link (URL):" under the tab #9 Redirects
Is this the proper way to set this up?
Thank you for your answers 
^ Yes that is correct 
Thank you Besmir, so it was that simple 
And for the C1, C2, C3 etc. tracking parameters that I want to fill with the tokens provided by ad netwoks, do you add them under the tab #10 (Get Rotating Lander) or at the very end under the tab #9 (Redirects)?
EDIT:
After testing Cx parameters and Keyword parameter in the URL, it seems that they are not tracked anymore when you use a rotating lander in a redirect rule... Can you confirm that?
Hmmm ok, actually it worked... But since we have to enter all the parameter at step #10, if one of them have to change (i.e. if the networks doesn't have an automated token like [creative]), we have to create one rule per creative.
At least, it's working now, I'll check out later if that can be optimized in some way 
Phew, glad this was sorted!