• Welcome to the most helpful Affiliate Marketing Forum. Join us! CLICK HERE for our free membership. You can upgrade to premium anytime to access more Premium training, case studies, & marketing resources.
  • POWER HOUR: 🚀💰 Master MULTI-CHANNEL Magic to Earn RECURRING Monthly Income! 💸🔥" Join Us! CLICK HERE FOR DETAILS
  • 📊 Latest Follow Along - $10,000 a Month Website Case Study 💡 Join the Discussion

Inserting Dynamic GEO Locations On HTML Landers

optimizepress

getmixy

Expired Membership
Messages
62
Reaction score
31
Points
18
Hello all,

I was wondering how to dynamically add geo locations to a html lander depending on where the visitor is coming from. For instance, with the following sentence:

People in (CITY) are buying this like crazy.

And the (CITY) would change out depending on the IP/GEO of the visitor.

How is this done?

Thanks
 

joeybabbs

Affiliate Marketing Coach
Staff member
Messages
2,628
Reaction score
1,691
Points
113
You need a script and then an account at a source to check the ip like ipinfo.io

Add this code to header:

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);


$ip = $_SERVER['REMOTE_ADDR']; //Get user IP
$token = "YOURTOKEN";//ipinfo.io Free token
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}?token=$token"));

$city = $details->city;
$region = $details->region;


?>

Add this to php.ini file:

allow_url_fopen = On


Add this to display city or region:

<?php echo $city; ?>

<?php echo $region; ?>
 

Newest Resources

Sponsors

semrush
Top