Redirect Visitors Based on Geo Location (RVBGL)

Adding geographic location to your landing page is a very powerful method to improve your PPT landing page and also increase your conversion rate as well because using geographic location you can easily win the trust of your visitors. Of course when on your landing page when you will tell your visitors that you have an exclusive offer for people in their city they will convert more easily, This not only works on ppv but also on other regular landing pages,

Here is the geolocation code I use for the movie site at  https://www.gatewan.com .

<!--myjoss geolocation-->
<script>
var endpoint = &#39;https://freegeoip.app/json/&#39;;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
    if (this.readyState == 4 &amp;&amp; this.status == 200) {
        var response = JSON.parse(this.responseText);
        console.log(response[&#39;country_name&#39;]);

      if(response[&#39;country_name&#39;] == &#39;Indonesia&#39;){
            window.location.replace(&quot;https://bundet.com&quot;);
        }
    }
};
xhr.open(&#39;GET&#39;, endpoint, true);
xhr.send();
</script>
<!--myjoss geolocation-->

The working principle of the code above is, if there are visitors from Indonesia, then I will throw (redirect) them to the home page of this site. In addition, I pass it, meaning that visitors other than from Indonesia can access my movie site  https://www.gatewan.com

The geolocation method is very important for retargeting visitors, this is usually done by SEO and Internet Marketing experts, I am one of them, hahaha.

Additionally, this was while still using the GeoIP service.

<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>

Post a Comment

Previous Next

نموذج الاتصال