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

![](/files/-M5WLo60tluLKElVBXFs)

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]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ae-docs.keywordrush.com/geotargeting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
