# UTM Parameters

UTM parameters are specific tracking codes that you can add to URLs to track them when users access those URLs. With the GeoIP app, you can utilize the UTM parameters functionality to forward the existing UTM parameters with the URL or add custom parameters in the app to forward with the URL.

Let's understand the UTM parameters with the help of an example:

1. This URL is clean and has no parameters: *<mark style="color:blue;">`https://spicegems.com`</mark>*
2. This is the URL with the UTM parameters: *<mark style="color:blue;">`https://spicegems.com?utm_source=GeoIP_Country_Redirect&utm_medium=US_Redirect_Rule&utm_campaign=popup`</mark>*

These are the initials of the UTM parameters in the URL:

* **utm\_source**
* **utm\_medium**
* **utm\_campaign**
* **utm\_term**
* **utm\_content**

## 1. **UTM Forward**

**UTM Forwarding** ensures that any custom tracking parameters added to links (outside the app) are forwarded to the destination store after redirection.

{% hint style="info" %}

#### **How It Works:**

* When a visitor arrives with UTM parameters (e.g., `?utm_source=google&utm_campaign=spring_sale`), enabling **UTM Forwarding** ensures these parameters are **preserved** after redirection.
* This helps maintain accurate tracking in marketing tools like Google Analytics and Facebook Ads.
  {% endhint %}

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2FdjbF5VjoAvhjityyRtC0%2FEnable_UTM_Forward.png?alt=media&#x26;token=d48e8a1b-b4dd-44d1-ae94-275b6bc0f3b9" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If the UTM forward is disabled, only the UTM parameters defined in the app will add in URL while redirection.
{% endhint %}

## 2. C**ustom UTM parameters**&#x20;

In the custom UTM parameters, you can add the custom parameters within the app. There are five fields in this block.

* UTM Source
* UTM Medium
* UTM Campaign
* UTM Term
* UTM Content

You can create the required UTM parameters to forward them with the URL to the destination store for tracking. &#x20;

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2FCSTRZkSvAkNImo2ijzA8%2FCustom_UTM.png?alt=media&#x26;token=e76c6e34-7c4e-4684-a012-770978ada902" alt=""><figcaption></figcaption></figure>

## Scenarios of UTM Forwarding and Custom Parameters&#x20;

**Functioning of UTM forwarding when used with or without Custom Parameters:**

### **1.** UTM Forwarding enabled and used with Custom Parameters

UTM forwarding is enabled, and we have added the custom UTM parameters in the rule:

* An existing UTM campaign runs on the source store (`line-item.myshopify.com`) with the following UTM parameters.

1. **utm\_campaign**=spring\_sale
2. **utn\_medium=web**
3. **utm\_source**= google

We have added the following Custom UTM parameters in the redirect rule:

* UTM Source - NA
* UTM Medium - NA
* UTM Campaign - NA
* **UTM Term = roger**
* **UTM Content = louis**

**This is the URL with existing UTM parameters**

`https://line-item.myshopify.com?utm_source=google&utm_medium=web&utm_campaign=spring_sale`&#x20;

* After redirection, the app's custom UTM will merge with the existing UTM available in the URL.&#x20;
* The  destination URL will look like the below URL

{% code overflow="wrap" %}

```
https://sg-localapp.myshopify.com?utm_campaign=Final_sale&utm_source=Instagram&utm_medium=autoredirect&UTM_Term=roger&UTM_Content=louis
```

{% endcode %}

*Note: The priority of existing UTM parameters (created outside the app) will be higher than the custom parameters created in the app.*&#x20;

*In case an existing UTM (for example, **utm\_campaign**=Final\_sale) is missing in the URL but created in the app (**utm\_campaign**=advertisement), the app will add and forward the custom UTM to the destination store with the URL.*&#x20;

### **2.** UTM Forwarding Enabled used without Custom Parameters&#x20;

If UTM forwarding is enabled and no custom parameters are added in the app:

* An existing UTM campaign runs on the source store (`line-item.myshopify.com`).

1. **utm\_campaign**=spring\_sale
2. **utn\_medium=web**
3. **utm\_source**= google

Original URL:\
`https://line-item.myshopify.com?utm_source=google&utm_medium=web&utm_campaign=spring_sale`

* After redirection, the destination URL maintains the existing UTM parameters:

Redirected to:\
`https://sg-localapp.myshopify.com?utm_source=google&utm_medium=web&utm_campaign=spring_sale`

{% hint style="info" %}
If you need any help, please contact us at **<help@spicegems.com>**
{% endhint %}
