The Most Active and Friendliest
Affiliate Marketing Community Online!

“AdsEmpire”/  Direct Affiliate

Any free geotargeting tool?

MaxMind GeoLite2-IP
But you have to know how to program to read the binary database you get for free and do some action or output some data .

So it's not really a tool --but it is free

This will get you started if you can code:

PHP:
<?php

$ip = ($_SERVER['REMOTE_ADDR']);


require_once("geoip2.phar");
    use GeoIp2\Database\Reader;

$reader = new Reader('GeoLite2-City_20201006/GeoLite2-City.mmdb');
$record = $reader->city($ip);
//$_SERVER['REMOTE_ADDR']);
// or for Country DB
// $reader = new Reader('/path/to/GeoLite2-Country.mmdb');
// $record = $reader->country($_SERVER['REMOTE_ADDR']);
//print($record->country->isoCode . "\n");
//print($record->country->name . "\n");
//print($record->country->names['zh-CN'] . "\n");
//print($record->mostSpecificSubdivision->name . "\n");
//print($record->mostSpecificSubdivision->isoCode . "\n");
//print($record->city->name . "\n");
//print($record->postal->code . "<p>");

$country_isoCode = ($record->country->isoCode);
$state = ($record->mostSpecificSubdivision->isoCode);

$city = ($record->city->name);
$postal = ($record->postal->code);
 
MI
Back