Skip to content
This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 1970397 Jul 4, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
geo Added IP anonymizer and removed deprecated service ( Aug 30, 2017 Added IP anonymizer and removed deprecated service ( Aug 30, 2017 Deprecated Jul 5, 2019

No longer maintained. Will not be upgraded for Craft 3.

Craft 3 alternatives include:

Geo Plugin for Craft CMS

A simple plugin to get information about your users location.

Put the geo folder in your craft plugins folder.

 # The following will cache the users location from their IP, so subsequent
 # api calls are not made, but just looked up in the cache:
{% set data = %}

{# which is the same as: #}
{% set data = %}

{# An Api call is made on every page view: #}
{% set data = %}

{# You can then access the data like this: #}
{{ data.country_code }}

Variables available in craft twig templates:

location: {{ }}
ip: {{ }}
country_code: {{ }}
country_name: {{ }}
region_code: {{ }}
region_name: {{ }}
city: {{ }}
zipcode: {{ }}
latitude: {{ }}
longitude: {{ }}
metro_code: {{ }}
areacode: {{ }}
cached: {{ }}

You are limited to 10,000 requests an hour for this plugin. It caches a single IP address for 12 hours by default. You can config this with a config file as explained below.

If you are in Crafts devMode or visiting the site from the server itself then a default IP adress will be used. This setting is configurable by creating a geo.php file in your craft/config folder. An example of this file is found in the geo-examples folder.


  • Add additional API endpoints for API redundancy.
  • Modularize enpoints so you can add your own endpoint plugins.



Pull requests welcome.

You can’t perform that action at this time.