Collect information about a visitor's location based on their IP address and store the information as a cookie.
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
geocookie
LICENSE
README.md

README.md

Geo Cookie Plugin for Craft CMS

Collect information about a visitor's location based on their IP address and store the information as a cookie.

The cookie is stored by default for 7 days, this value can be changed in the config.php file.

Installation

Upload the geocookie folder to your plugins folder.

Usage

Setting the variable

{% set location = craft.geoCookie.location() %}

Available variables

Value Usage
IP address {{ location.ip }}
Country code {{ location.country_code }}
Country name {{ location.country_name }}
Region {{ location.region }}
City {{ location.city }}
Latitude {{ location.latitude }}
Longitude {{ location.longitude }}
Cached {{ location.cached }}

Licence

MIT