2/05/2013

Expose Content to Target Audience With Geo Targeting Scripts

Join the Most Lucrative Affiliate Site at QpidAffiliate.com

Recently I have received a message from a partner of Qpid Afiliate Program and asking for advice. His problem could be described like this.

Nick, the partner who has joined Qpid Affiliate Program for over 3 months, is running a website containing  a big category of photos and articles and receiving massive traffic from countries all over the world. He writes dating advice as well as life tips and reviews of movie and music. The variety of his reader contribute a  good earning for him but there's a problem: many visitors who are from Asian countries also tend to click the ChnLove banners. But since these members are not from one of the specific countries listed in the valid member condition, Nick earns nothing from that. He also registered in other affiliate programs and he is disappointed with that once the visitor bounces out he is not likely return to try other products listed on Nick's websites.

So how to solve the problem- keep exposing Qpid banners to the targeting audience and make use of the traffic does not meet Qpid Network's requirement?

The answer to Nick's case is geo targeting.

I asked Nick to install geo targeting scripts in all the webpages and set such conditions:

(1) when the visitor is detected as from one of those countries, he will see 2-3 ads from Qpid Affiliate in every page.

(2) when the visitor is from a country not listed above, it's OK to hide our banners and leave the space for other ads.

After the scripts are done, we follow up his account statistics and make records. The result is quite satisfying: he sees an apparent rise in conversions in the next month because our ads are getting exposed more frequently and this also help to increase his income from other programs.

----
So what is geo targeting?

As Wikipedia defines that, Geo targeting in geomarketing and internet marketing is the method of determining the geolocation of a website visitor and delivering different content to that visitor based on his or her location, such as country, IP address, ISP or other criteria.

The task is to implement a way to target those available countries as required.

Hostip is a good tool and pretty simple to use, all you have to do is make a connection to a API url with the IP address you wish to locate and it can return information like the country the IP address – here is a sample URL:

http://api.hostip.info/country.php?ip=64.233.160.5

As you can see it returns “US” which is the 2 character country code for the United States. We can implement this into PHP to get the current visitors country by using this code:

$ip = $_SERVER [ 'REMOTE_ADDR' ];
$country = file_get_contents ( 'http://api.hostip.info/country.php?ip=' . $ip );


$country
 will now hold the country code (remember it is in UPPER CASE). You can 
then simply check what the value is and target an advert or particular 
content depending on the user:


"<?php
if ( $country == "//here is your targeting country code" ) { 
?>


[QpidAffiliate's Code];
<?php } ?>"
Replace with the exact country code and "[QpidAffiliate's Code]" with the js code, for example:

<?php
if ( $country == "GB" ) { 
?>
 <script type="text/javascript" src="https://www.qpidaffiliate.com/index.php/promote/js?aid=xxx&oid=CPxxxxx"></script> 
<?php } ?>


Nick adds these country codes: US,NL,AT,AU,BE,CA,CH,DE,DK,ES,FI,FR,UK,IE,IS,IT,NO,NZ

External Requests

Please bare in mind that you are requesting information from an external source, depending on server health and traffic, the response may take from milliseconds to minutes to complete. So as a precaution you should “save” the result so that you do not have to keep requesting the information from hostip.info. Here is an example code that you could use:

if (!isset($_SESSION['country'])) {
$ip = $_SERVER [ 'REMOTE_ADDR' ];
$_SESSION['country'] = file_get_contents ( 'http://api.hostip.info/country.php?ip=' . $ip );
}
You can now access the value from $_SESSION['country'], once this has been set it will no longer ask the external source saving them bandwidth and you loading time.Applying it with "QpidAffiliate's Links & Code"

<?php
if ( $_SESSION['country'] == "//targeting countries" ) {
?>
 [QpidAffiliate's code]
<?php } ?>

----

Nick's story is a good case for us to learn something about affiliate marketing, so you can give it a try if you are facing similar problems.

Also, please note that this article is to share a particular marketer's story than providing a common solution.It is suggested to contact your affiliate manager for personalized advices.