Solved

Calling different page depending on IP location

Posted on 2014-07-17
1
68 Views
Last Modified: 2015-03-19
I was contacted by an ad network who is proposing to pay us more for our advertising space. The way they do it is by setting a floor price for our ads. When a user enters our site, we call their adserver and if they have an ad that pays more than the floor price we set, their banner is displayed, if not, then they call our own adserver and we display an ad ourselves, like we always do.

The problem we have, is that we are based in Guatemala, and although most of our traffic comes from Guatemala, we also have a lot of traffic from the US which pays a lot better than ads from Guatemala or the rest of Latin America.

The ad network told us to create 2 accounts so that we could have 2 different floor prices: one floor price for the US, and one floor price for the rest of the world and to call the appropriate account depending on the user's IP.

So what I need to do is:

1) When the user enters my site, check his IP location.

2) If the user is from the US, we call an html page with the first ad network code, so it checks for higher paying ads than the floor price that we set for the US

3) But if the user is from any other country, we call another html page with the second ad network code, so it checks for higher paying ads than the one we set for the rest of the world, which would be lower than the floor price set for the US

Is there a simple way to do this?

Thank you
0
Comment
Question by:svensanchez
1 Comment
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40203879
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question