Geo Location

  • Jamroom 5 Geo Location Module

    The Geo Location module provides 2 new Smarty functions for your use in templates:

    {jrGeo_location} - get location information for an IP Address
    {jrGeo_distance} - get the physical distance between 2 Ip Addresses
  • Important! This module requires you to properly upload a Free GeoLite City Database file before it can be used! See Geo Location - Global Config for more information.
  • {jrGeo_location}

    Function
    {jrGeo_location}
    parameter
    type
    default
    required
    description
    ip
    string
    -
    on
    the ip address of the location you are trying to locate
    template
    string
    -
    off
    the output format of the returned information
    assign
    string
    -
    off
    if you want the output assigned to a variable, put the name of the variable.
    Example Usage:

    Get Location for viewing user (using defaults):

    {jrGeo_location}

    Get Location for viewing user (using inline template):

    {jrGeo_location template="You are from %region%"}

    Get Location for viewing user (defining ip):

    {jrGeo_location ip="1.2.3.4" template="Location: %city%, %region%"}

    Available template variables are:
    %country_code%
    %country_code3%
    %country_name%
    %region%
    %city%
    %postal_code%
    %latitude%
    %longitude%
    %area_code%
    %dma_code%
    %metro_code%

  • {jrGeo_distance}

    Function
    int {jrGeo_distance} (
    string ip1,
    string ip2,
    string template
    )
    parameter
    type
    default
    required
    description
    ip1
    string
    -
    on
    the first ip address to set as point 1
    ip2
    string
    -
    on
    the second ip address to set as point 2
    template
    string
    -
    the format in which to display the output.
    Example Usage:

    Get distance (in miles) between 2 IP locations:

    {jrGeo_distance ip1="1.2.3.4" ip2="2.3.4.5"}

    Get distance (in kilometers) between 2 IP locations:

    {jrGeo_distance ip1="1.2.3.4" ip2="2.3.4.5" template="%kilometers%"}
  • System Check Warning

    In your System Check tool in the ACP you might have noticed a warning "Install the free Geo Location module from the marketplace" and are wondering why you are being requested to install it.
  • screenshot of the System Check warning in the ACP
  • The Geo Location module gets a user's physical location based on their IP Address. This is used by the Mail Core when generating statistics for the Newsletter module (and other modules that can request campaign support).

    If you plan on using the Newsletter module installing this module will help you gather more interesting stats about the locations your newsletters are going out to.
  • screenshot of the View Stats button in the Newsletter Browser
  • screenshot of the location data displayed on the newsletter stats map

Tags