Menambahkan lokasi geografis ke halaman arahan adalah metode yang sangat ampuh untuk meningkatkan halaman arahan PPT dan juga meningkatkan tingkat konversi Anda juga karena menggunakan lokasi geografis Anda dapat dengan mudah memenangkan kepercayaan pengunjung. Tentu ketika di halaman arahan ketika Anda akan memberi tahu pengunjung Anda bahwa Anda memiliki penawaran eksklusif untuk orang-orang di kota mereka, mereka akan lebih mudah mengonversi, Ini tidak hanya berfungsi pada ppv tetapi juga pada halaman arahan biasa lainnya,
Berikut adalah kode geolocation yang saya gunakan untuk situs movie di https://www.gatewan.com.
<!--myjoss geolocation-->
<script>
var endpoint = 'https://freegeoip.app/json/';
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var response = JSON.parse(this.responseText);
console.log(response['country_name']);
if(response['country_name'] == 'Indonesia'){
window.location.replace("https://bundet.com");
}
}
};
xhr.open('GET', endpoint, true);
xhr.send();
</script>
<!--myjoss geolocation-->
Prinsip kerja kode diatas adalah, jika ada pengunjung yang berasal dari Indonesia, maka akan saya lempar (redirect) ke home page situs ini. Selain itu saya loloskan, artinya pengunjung selain dari indonesia dapat mengakses situs movie saya https://www.gatewan.com
Metode geolocation sangat penting untuk melakukan retargeting pengunjung, ini biasa dilakukan oleh pakar SEO dan Internet Marketing, saya adalah salah satunya wkwkw.
Tambahan, ini saat masih menggunakan service dari GeoIP.
<script>
/*!
* GeoIP Target Redirector
* Copyright (c) 2014-15 Syed I.R
* Licensed under the MIT.
* Project: https://github.com/irazasyed/geoip-target-filter
*
* ---------------------------------------------------------------------
* A small snippet for geo-target redirection using GeoIP API.
* Add your targeted country's "ISO 3166-1 - Alpha-2" code and
* redirect URL to the "target" array object.
* ---------------------------------------------------------------------
* Example:
* //target.All = "http://others.tld";
* //target.US = "http://domain.tld";
*
* The above example will redirect all the US visitors to the given URL.
* And any non-targeted visitors to "All" URL.
* ---------------------------------------------------------------------
* Country Codes can be found @( Wikipedia - http://bit.ly/nWBMYz )
* See Column: "Alpha-2 Code"
* ---------------------------------------------------------------------
*/
var target = []; // Create a new target Array.
// Example Codes:
target.All = " http://ads.affbuzzads.com/redirect?ref=171640&ad_unit=64"; // Redirects Non-targeted
/*
target.US = "#";
target.AU = "#";
target.CA = "#";
target.DE = "#";
target.ES = "#";
target.FR = "#";
target.UK = "#";
target.NZ = "#";
target.SE = "#";
target.SA = "#";
target.MY = "#";
target.PL = "#";
target.MD = "#";
target.TR = "#";
target.JO = "#";
target.HK = "#";
target.MA = "#";
target.TL = "#";
target.PG = "#";
*/
target.ID = "http://adf.ly/2476008/box-office-id";
// ------------------------------------------------------
// DON'T EDIT THE BELOW CODE UNLESS REQUIRED
// ------------------------------------------------------
/**
* If a valid country code matches the targets list, then it redirects to that particular link.
* Otherwise redirects to "All" target URL.
*/
function geoip(g){window.top.location.href=target[g.country_code]||target.All}
(function(g,e,o,i,p){i=g.createElement(e),p=g.getElementsByTagName(e)[0];i.async=0;i.src=o;p.parentNode.insertBefore(i,p)})(document,'script','https://freegeoip.net/json/?callback=geoip');
</script>