> ## Documentation Index
> Fetch the complete documentation index at: https://docs.momentco.io/llms.txt
> Use this file to discover all available pages before exploring further.

# URL Parameters

> Learn how to track marketing campaign attributes using URL parameters on bill presentment

## Overview

Moment enables you to drive payment volume directly via your marketing and customer lifecycle strategies — including EDM, digital advertising, messaging, and more — by enabling you to:

* **Track marketing campaign attributes** as URL parameters through the **Electronic Bill Presentment (EBP)** journey (e.g. `utm_*`)
* **“Fast Forward” customers** through the payment journey by pre-filling their account identifier and pre-populating their product or purchase selections to skip pages, reducing clicks
* **Directly collect payments** from new prospect customers and complete sign-up after they’ve successfully made an optional product selection and their payment
* **Attribute sales partner resources**, including field agents and affiliate marketing programs
* **Customize your reporting** endlessly by tracking both supported fields and arbitrary fields unique to your business
* **Use optional URL parameter behaviors** to give you the customization you need

```text theme={"system"}
https://{merchant}.momentpay.io/{country?}/{id?}?<querystring>
```

## URL parameters — details

* `country` and `id` are optional path parameters (before `?`).
* Remaining fields are standard query parameters placed after `?` to populating the `<querystring>`
* A wide range of Supported Parameters are listed below, in addition
* Unknown Parameters not listed below will be captured and stored as Metadata.

### Encoding & limits

* URL-encode values (including spaces as `%20` or `+`).
* We recommend the list of URL parameters to be ≤ **256** chars, up to a total URL length of ≤ **\~2,000** chars
* Parameter names and values are **case-insensitive**.

***

## Supported parameters

| **Parameter**             | **Required?** | **Description**                                                                                                                              | **Examples**                                  |
| ------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| `country` (path)          | Optional      | ISO-3166-1 alpha-2 country code                                                                                                              | `ZA`, `NG`, `KE`                              |
| `id` (path)               | Optional      | **MSISDN** (digits only, no country code), **email**, or an **alphanumeric customer identifier** (e.g., CRM/user ID); appears **before `?`** | `0821234567`, `821234567`; `user@example.com` |
| `lg`                      | Optional      | 2-letter language code                                                                                                                       | `en`, `fr`, `pt`                              |
| `affiliate`               | Optional      | Affiliate/channel identifier                                                                                                                 | `AFFILIATE_A`, `SOCIAL`                       |
| `agent`                   | Optional      | Sub-affiliate/agent ID                                                                                                                       | `agent-5521`, `a42f7`                         |
| `product_code`            | Optional      | Product identifier for pre-selection (uppercase + `_` recommended)                                                                           | `BASIC_MONTHLY`, `PREMIUM_ANNUAL`             |
| `allow_product_selection` | Optional      | Boolean to force **show the product chooser** even if `product_code` is sent.                                                                | `true`, `false`                               |
| `utm_source`              | Optional      | UTM: traffic source                                                                                                                          | `braze`, `facebook`, `newsletter`             |
| `utm_medium`              | Optional      | UTM: medium                                                                                                                                  | `email`, `sms`, `cpc`                         |
| `utm_campaign`            | Optional      | UTM: campaign name                                                                                                                           | `summer_sale_2025`, `winback_q4`              |
| `utm_term`                | Optional      | UTM: keyword                                                                                                                                 | `sports+subscription`                         |
| `utm_content`             | Optional      | UTM: creative/variant                                                                                                                        | `hero_banner_a`, `cta_blue`                   |
| `metadata`                | Optional      | Free-form key/value pairs as a single field. Format: `key=value\|key2=value2` (values URL-encoded).                                          | `lid=wgc78f63m4sr\|segment=A1`                |

## Behaviour and precedence

### Defaults

All parameters are optional. Missing or invalid values are ignored and EBP / Checkout will continue with default behaviour.

### Fast Forward

By pre-filling valid parameters, customers can be skipped through the journey

* Provide a valid `id` for the customer and they’ll skip searching for their account.
* With a valid `product_code` **and** `allow_product_selection=false`, they’ll skip directly to the payment step with that product (e.g. a promotional item) pre-selected.
* With a valid `product_code` **and** `allow_product_selection=true`, they’ll see the product pre-selected but will have the option to choose an alternative from the product chooser.

### Storage

* Known parameters (`utm_*`, `affiliate`, `agent`, `product_code`, `metadata` etc.) are stored as they are.
* Unknown parameters are also stored in `metadata` alongside the original value of the metadata field. It keeps arbitrary keys out of the top-level namespace while still allowing flexible context.

### Surfacing

Captured values are available in **webhooks**, **exports**, and **analytics** (where they have been enabled for your Moment merchant account).

***

## Examples

**Email `id`, UTM, product pre-select**

```text theme={"system"}
https://example.momentpay.io/ZA/user%2Bpromo@example.com?utm_source=newsletter&utm_medium=email&utm_campaign=summer_sale_2025&product_code=PREMIUM_ANNUAL&allow_product_selection=false&affiliate=AFFILIATE_A&agent=agent-5521&metadata=lid%3Dwgc78f63m4sr%7Csegment%3DA1
```

**MSISDN `id`, (no country code), force chooser**

```text theme={"system"}
 https://example.momentpay.io/NG/0821234567?utm_source=sms&utm_medium=sms&utm_campaign=winback_q4&allow_product_selection=true&metadata=ref%3Dabc123%7Clocale%3Den
```

## `metadata` behaviour

* If a **known parameter** is passed **inside `metadata`** (as `key=value`), it is **stored as a typed field** just like when sent as a top-level query param. The raw `metadata` string is also preserved.
* If an **unknown parameter** is present in the URL, it is **added to the `metadata` blob** (in addition to any explicit `metadata` value you send).

> **Format reminder**\
> `metadata` is a single string of URL-encoded pairs joined by `|`, e.g. `key=value|key2=value2`.\
> Unknown top-level params are recorded as `key=value` entries inside `metadata`.

***

### Examples

#### 1. Only `metadata` provided (no unknown params)

**URL:**

```text theme={"system"}
https://example.momentpay.io/ZA/user%2Bpromo@example.com?metadata=value
```

**Stored**

```text theme={"system"}
metadata: "value"
```

#### 2. `metadata` provided and an unknown top-level param

**URL:**

```text theme={"system"}
https://example.momentpay.io/ZA/user%2Bpromo@example.com?unknownparam-1=value-1&metadata=value
```

**Stored**

```text theme={"system"}
metadata: "value|unknownparam-1=value-1"
```

#### 3. Only unknown top-level param (no metadata provided)

**URL:**

```text theme={"system"}
https://example.momentpay.io/ZA/user%2Bpromo@example.com?unknownparam-1=value-1
```

**Stored**

```text theme={"system"}
metadata: "unknownparam-1=value-1"
```
