Geotargeting
Last updated
Last updated
From Affiliate Egg 6.9 you can display different storefronts for users from different countries (based on user IP)
To use this function:
Install a free plugin GeoIP Detection
: https://wordpress.org/plugins/geoip-detect/
Setup GeoIP Detection
(check manuals for GeoIP Detection).
Now, you can use additional parameters in Affiliate Egg storefront shortcodes.
An example:
Available parameters:
country_code
country_name
region
region_name
city
continent_code
Go to Tools
→ GeoIP 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.
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:
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: