# Understanding the App functionality

Using our GeoIP app, you can redirect visitors from the primary domain/URL to the destination domain/URL based on their country IP and the rules configured in the primary store app.

&#x20;Our app works with the coordination of the domain and the IP of the visitors following the rules created for the required country visitors.

Let's understand the functionality with the help of an Example:

> You have two stores:
>
> * **Canadian Store - Local store**&#x20;
> * **USA Store - Global store**

{% hint style="info" %}
Note: To manage traffic vice versa on both stores, you need to install the app on both Shopify stores
{% endhint %}

Using our GeoIP app, you can keep the Canadian visitors on Canada (local) store and redirect the rest of the world (global visitors) to the USA (Global) store.

With our GeoIP app, you can set up the rules in the app to implement the following functionality:

> 1. Only Canadian visitors can access the Canada (local) store and all visitors **except** Canadians will be redirected to the USA **(global)** store.
> 2. If Canadian visitors land on the USA (global) store then they will be redirected to the Canada (Local) store.

* Local Store (sg-localapp.myshopify.com)
* Global Store (line-item.myshopify.com)

<figure><img src="/files/QTYwksYlbpwfjaA8Puca" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
It is recommended to review the[ interpretation of the redirect rule](/geoip-country-redirect/general-features/interpretation-of-a-redirect-rule.md) before moving on to creating redirect rules.
{% endhint %}

### Configure app on Canada (Local) store - (sg-localapp.myshopify.com):

In the Canada store, we only need to manage the Global Visitors.

For the above, you need to create only one rule as mentioned below.

1. **Rule Name:** Global Rule (you can use any name as per your need)
2. **Visitors Country:** Add all countries **except Canada**
3. **Redirect To Store URL:** Global (USA) store URL (line-item.myshopify.com)
4. **Store Name:** Line Item USA (you can use the name as per your need)
5. **Redirection Type:** Display-based redirection (we are using pop-up for the redirection)

The set-up is done in the Canadian store.&#x20;

Now to set up the redirection for Canadian visitors on the Global store, create a rule in the Global (USA) store app.

### Configure on Global store (line-item.myshopify.com):

In the Global (USA) store, we only need to manage the Canadian Visitors.

For the above, you need to create only one rule as mentioned below.

* **Rule Name:** Local Rule (you can use any name as per your need)
* **Visitors Country:** Add the Canada
* **Redirect To Store URL:** Local store URL (we are taking "sg-localapp.myshopify.com")
* **Store Name:** SG LocalApp (you can use the name as per your need)
* **Redirection Type:** Auto Redirection

### [**Create a redirect rule**](/geoip-country-redirect/country-redirect/create-redirect-rule.md)

[**How to create exception-based redirect rule in the app?**](/geoip-country-redirect/country-redirect/create-exception-based-redirect-rule.md)


---

# 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://help.spicegems.com/geoip-country-redirect/general-features/setup-the-app-for-redirection.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.
