The Most Active and Friendliest
Affiliate Marketing Community Online!

“Adavice”/  “1Win

Help with Geo-location Script

Ma'at Hetep

Member
Hello members,

So I will be glad to receive assistance with how to write a geolocation script. I just realized that it would require some proficiency with Javascript (JS) though at the moment I'm more conversant with HTML and CSS.

I have been working on my landing pages using my code editor so far and felt I could take things a bit further if each visitor that lands on my page actually see their actual location being mentioned.

For example, if I were dealing in Michael Kors handbags, and a visitor clicks on my website link, I would like them to see something along the lines of "Find the best Michael Kors handbag deals in Country (and/or city probably). I feel this will personalize the message and help the visitor a lot.

Is there a way to achieve this? I would like to start with a single-page website to see how it goes, in case I'm able to get help here. Thanks in advance and I look forward to your assistance!
 
You can easily use our tool (Capture token) in PureLander, you won't need any coding knowledge :D:D

- Samira
 
capture? for what? do what?
you just get a cluttered URL with the user's ISO2(usually) staring in his face if he *even* looks at the address bar ...


can you do this I can and the user never sees :D
PHP:
<?php
require_once 'vendor/autoload.php';
use GeoIp2\Database\Reader;

// This creates the Reader object, which should be reused across
// lookups.
$reader = new Reader('/usr/local/share/GeoIP/GeoIP2-City.mmdb');

// Replace "city" with the appropriate method for your database, e.g.,
// "country".
$record = $reader->city('128.101.101.101');

print($record->country->isoCode . "\n"); // 'US'
print($record->country->name . "\n"); // 'United States'
print($record->country->names['zh-CN'] . "\n"); // '美国'

print($record->mostSpecificSubdivision->name . "\n"); // 'Minnesota'
print($record->mostSpecificSubdivision->isoCode . "\n"); // 'MN'

print($record->city->name . "\n"); // 'Minneapolis'

print($record->postal->code . "\n"); // '55455'

print($record->location->latitude . "\n"); // 44.9733
print($record->location->longitude . "\n"); // -93.2323

print($record->traits->network . "\n"); // '128.101.101.101/32'

The GeoLite2-City.mmdb (the free one) does not have all of these functions.
However, you can get the browser's preferred languages with simple PHP in the same script and render the correct transulation on a dynamic website.


Some changes required to build your own custom scripting --but you need to be competent to code them.
Go up to the main and you will find others, like: Python, Java, etc --whatever floats your boat ...
 
Last edited:
How does it work?

1640295799670.png


1640295922455.png


Verizon ads sees (because they can code) that my second language is Mexican-Spanish and thinks I may have more affinity toward an ad in my native or ancestral language --fooled ya' :D
 
banners
Back