page loader

Geo Javascript

Overview

The Geo Javascript service allows you to obtain visitor location data directly in your website using simple JavaScript functions.

The Geo Javascript service is useful when you require visitor location data for complete customization of your website or to carry out complex functions that cannot be achieved through our standard services.

Key Features

  1. Obtain visitor country code, country name, state name and city name
  2. Obtain visitor latitude and longitude coordinates
  3. Turn ON/OFF entire service easily
  4. Simulate a visitors country, state or city
  5. Easy integration into website by pasting one line of JavaScript code in website HEAD
  6. WordPress shortcode plugin available

Paid Service

The Geo Javascript service is a paid service as we are unable to brand it. Impressions are required to be purchased before using this service.

Setup Screenshot

 Geo Javascript

Start

The START panel contains important setup details of your website

Name

An optional name to identify the Geo Javascript

Short Description

An optional description for the Geo Javascript

Geo Java Status

If this option is ON, the service will be active.

If this option is OFF, the service including the default location data will be inactive

Use this option to easily turn OFF the service rather than removing the code from your website each time you want to disable the service.

Settings

Usage Website URL

Website URL where the Geo Javascript service will be used. Must contain http: or https: depending if you have an SSL certificate.

Usage Level

If ‘Entire Website’ option is selected, then the service will be available throughout your website or all subpages of the Landing URL.

If ‘Specified URL Only’ is selected, then the service will only be available in the URL specified.

To utilize this service throughout your website, the Landing URL only needs to be your website domain e.g. http://example.com and the ‘Entire Website’ option should be selected.

Default Country Text

In some cases IP to location technology cannot determine a visitor’s location. Rather than allowing the visitor’s country to be blank, you can specify a default country name. This is especially useful when using this service to display visitor country name in your website.

Default State Text

In some cases IP to location technology cannot determine a visitor’s location. Rather than allowing the visitor’s state to be blank, you can specify a default state name. This is especially useful when using this service to display visitor state name in your website.

Default City Text

In some cases IP to location technology cannot determine a visitor’s location. Rather than allowing the visitor’s city to be blank, you can specify a default city name. This is especially useful when using this service to display visitor city name in your website.

Code

The Code panel provides the required JavaScript snippets to paste into your website.

Geo Java Code (For non SSL domains)

If you website is not SSL protected you can use this script. Paste the script in between your website’s HTML HEAD tags.

<HEAD>

<script type=’text/javascript’ src=’http://www.geolify.com/geojavascript.php?id=XXX’></script>

…..

</HEAD>

Geo Java  Code (For SSL domains)

If you website is SSL protected you can use this script. Paste the script in between your website’s HTML HEAD tags.

<HEAD>

<script type=’text/javascript’ src=’https://www.geolify.com/geojavascript.php?id=XXX’></script>

…..

</HEAD>

Javascript ID (For WordPress Plugin)

Paste this ID into the WordPress Geo Java input to utilize WordPress shortcodes.

 

 

Country Name

Provides the country name of the visitor via a JavaScript function.

Example on how to use the country name as a JavaScript variable in your website:

<HEAD>

<script>

var countryname = geolify_country_name()

</script>

</HEAD>

Example on how to display country name in your website

<BODY>

Visitor is from <script>document.write(geolify_country_name())</script>

</BODY>

 

State Name

Provides the state name of the visitor via a JavaScript function.

Example on how to use the state name as a JavaScript variable in your website:

<HEAD>

<script>

var statename = geolify_state_name()

</script>

</HEAD>

Example on how to display state name in your website

<BODY>

Visitor is from <script>document.write(geolify_state_name())</script>

</BODY>

 

City Name

Provides the city name of the visitor via a JavaScript function.

Example on how to use the city name as a JavaScript variable in your website:

<HEAD>

<script>

var cityname = geolify_ city _name()

</script>

</HEAD>

Example on how to display city name in your website

<BODY>

Visitor is from <script>document.write(geolify_city _name())</script>

</BODY>

 

Latitude

Provides the latitude of the visitor via a JavaScript function.

Example on how to use the latitude as a JavaScript variable in your website:

<HEAD>

<script>

var latitude = geolify_ latitude ()

</script>

</HEAD>

Example on how to display latitude in your website

<BODY>

Visitor latitude is <script>document.write(geolify_latitude())</script>

</BODY>

 

Longitude

Provides the longitude of the visitor via a JavaScript function.

Example on how to use the longitude as a JavaScript variable in your website:

<HEAD>

<script>

var longitude = geolify_longitude ()

</script>

</HEAD>

Example on how to display longitude in your website

<BODY>

Visitor longitude is <script>document.write(geolify_longitude())</script>

</BODY>

Testing

The testing panel allows simulation of a location to allow you to test how visitor location data will behave on your website.

Test Mode

Turn ON or OFF test mode using this option.

If this option is ON, test mode will be active and the visitor location will be simulated.

If this option is OFF, test mode will be inactive and the visitor location will be determined using IP address of the visitor

IMPORTANT: Remember to turn test mode OFF once testing is complete or else visitor IP to location will not work and all visitors will have a location equal to the simulated location.

Test Country

Country name to be simulated. Start typing a country name and select a matching name from the drop down. This field can be left blank if country simulation is not required.

Test State

State name to be simulated. Start typing a state name and select a matching name from the drop down. This field can be left blank if state simulation is not required.

Test City

City name to be simulated. Start typing a city name and select a matching name from the drop down. This field can be left blank if city simulation is not required.

Buttons

Save

This button will save the Geo Javascript setup for later use.

Exit

This button will exit the setup without saving.