# 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:

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

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.

![](https://940736139-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5W1lOLsBsZnXap8X6J%2F-M5WLHHjRJJ7UFTM8f9h%2F-M5WLo60tluLKElVBXFs%2FNewItem9.png?alt=media\&token=56b83d74-ffbd-4d7b-beca-db42919117c0)

You can use several parameters divided by comma.&#x20;

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

```php
[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:

```php
[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:

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