Geotargeting

From Affiliate Egg 6.9 you can display different storefronts for users from different countries (based on user IP)

To use this function:

  1. Install a free plugin GeoIP Detection: https://wordpress.org/plugins/geoip-detect/

  2. Setup GeoIP Detection (check manuals for GeoIP Detection).

  3. Now, you can use additional parameters in Affiliate Egg storefront shortcodes.

An example:

[affegg id=1 country_code=US region_name=California]

Available parameters:

  • country_code

  • country_name

  • region

  • region_name

  • city

  • continent_code

Go to ToolsGeoIP Lookup and check how these parameters are stored in the plugin.

You can use several parameters divided by comma.

For example, the next shortcode means that the storefront will be visible for users from USA, California and Arizona states.

[affegg id=1 country_code=US region_name=California,Arizona]

You can use the symbol ! before the value. This means that the storefront will be visible for all EXCEPT value.

For example, the next shortcode makes the storefront visible for all, except users from Australia:

[affegg id=1 country_code=!AU]

Unfortunately, geoip bases are not 100% full and correct, so you can use the special parameter null which will be used when data is not existing. For example, the next code will show the storefront for users from US, but when the state of user's IP is not determined in the geoip database:

[affegg id=1 country_code=US region_name=null]

Last updated