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

# URL Source Collector

> Capture UTM parameters, ad click IDs, referrer URLs, and custom values from the visitor's URL and submit them alongside your form data for attribution tracking.

# URL Source Collector

**URL Source Collector** is a hidden component that silently captures data from the visitor's URL or referrer and submits it alongside your form - so you can track exactly where your leads, signups, and conversions come from without asking the user a single extra question.

Add the component to any form, pick what to capture, and the values are automatically included in every submission.

<Info>
  The component renders **nothing visible** to the visitor - it has no UI on the form. Its captured value is submitted as a hidden field with the rest of the form data.
</Info>

## Why Use It

Use URL Source Collector to track attribution for:

* **Paid ads** - Google, Meta (Facebook/Instagram), Microsoft (Bing), LinkedIn, TikTok, X (Twitter)
* **UTM campaigns** - `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`
* **Referring sites** - which external websites are sending you traffic
* **Custom URL parameters** - promo codes, partner IDs, plan slugs, etc.
* **Per-page source tags** - know which landing page or CTA converted

***

## How to Add the Component

1. Open **Forms Plugin** in Framer
2. Select your form on the canvas
3. Insert the **URL Source Collector** component
4. In the properties panel, choose what to capture and configure the options

That's it - every submission from that form will now include the captured value.

***

## Capture Modes

The **Capture** dropdown is the main control. It decides what the component reads and submits. There are five modes:

| Mode              | What It Captures                                                       |
| ----------------- | ---------------------------------------------------------------------- |
| **UTM Tags**      | UTM parameters and paid ad click IDs - each becomes its own form field |
| **Current URL**   | The full URL of the page the visitor submitted from                    |
| **Referrer URL**  | The URL of the page the visitor came from (external referrer)          |
| **URL Parameter** | Any specific query-string parameter you name                           |
| **Custom Value**  | A literal static value you set manually (no URL reading)               |

Each mode has its own settings, described below.

***

### UTM Tags

Captures all standard UTM parameters from the current URL and submits each one as its own form field with a matching name.

**Automatically captured UTM keys:**

* `utm_source`
* `utm_medium`
* `utm_campaign`
* `utm_term`
* `utm_content`

You can also turn on paid ad platform toggles to capture click IDs:

| Platform             | Click IDs Included                                 |
| -------------------- | -------------------------------------------------- |
| **Google Ads**       | `gclid`, `gad_source`, `gbraid`, `wbraid`, `dclid` |
| **Meta (Facebook)**  | `fbclid`                                           |
| **Microsoft (Bing)** | `msclkid`                                          |
| **LinkedIn**         | `li_fat_id`                                        |
| **TikTok**           | `ttclid`                                           |
| **X (Twitter)**      | `twclid`                                           |

<Info>
  In UTM Tags mode, there is **no Field Name setting** - because every UTM key and click ID becomes its own form field automatically. For example, if the URL contains `?utm_source=google&gclid=abc123`, the submission will have both `utm_source: google` and `gclid: abc123` as separate fields.
</Info>

**Available settings:**

* **Fallback** - default value submitted when the URL has no UTM data (e.g. `direct`)
* **First-Touch** (Yes / No) - persist the first-visit values across internal navigation and return visits
* **Ad platform toggles** - turn each platform On or Off to include its click IDs

<Tip>
  Only turn on the ad platforms you actually run campaigns on. This keeps your submissions clean and avoids sending empty click-ID fields.
</Tip>

***

### Current URL

Captures the full URL of the page the visitor submitted the form from - protocol, domain, path, and query string. Useful when you want to know the exact landing page of every conversion.

**Available settings:**

* **Field Name** - the form field name this value submits as (default: `source`)
* **Fallback** - default value if the URL can't be read
* **First-Touch** (Yes / No) - persist the first-visit URL

***

### Referrer URL

Captures the URL of the external page the visitor came from (based on `document.referrer`). If the visitor typed your URL directly or came from a bookmark, the referrer will be empty - in that case, the Fallback value is used.

**Available settings:**

* **Field Name** - form field name this value submits as
* **Fallback** - default value when no referrer is available (e.g. `direct`)
* **First-Touch** (Yes / No) - remember the first-touch referrer across the session

***

### URL Parameter

Captures one specific query-string parameter by name. Use this mode when you care about a single custom parameter that isn't a standard UTM tag - like `?promo=SUMMER50`, `?ref=partner-name`, or `?plan=pro`.

**Available settings:**

* **Field Name** - form field name this value submits as
* **Parameter** - the query-string parameter name to read (e.g. `promo`, `ref`, `plan`)
* **Fallback** - default value when the parameter isn't present in the URL

**Example:**

For the URL `https://yoursite.com/pricing?promo=SUMMER50`:

* Set **Parameter** to `promo`
* Set **Field Name** to `promo_code`
* The submission includes `promo_code: SUMMER50`

***

### Custom Value

Submits a literal static value - not read from the URL at all. Useful for per-page or per-variant source tagging where you want to hard-code the source identifier.

**Available settings:**

* **Field Name** - form field name this value submits as
* **Value** - the literal string to submit (e.g. `homepage-hero`, `pricing-footer`)

**Example:** If the same form appears on three pages and you want to know which page converted:

| Page          | Value           |
| ------------- | --------------- |
| Homepage Hero | `homepage-hero` |
| Pricing Page  | `pricing-page`  |
| Blog Footer   | `blog-footer`   |

Add the component to each page's form and set a different **Value** per page. Every submission now tells you exactly which slot converted.

***

## First-Touch Attribution

The **First-Touch** toggle is available in **UTM Tags**, **Current URL**, and **Referrer URL** modes. It controls how the component treats return visits and internal navigation:

| Option                                | Behavior                                                                                                                                                                                                                                                                        |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Yes** (recommended for attribution) | Remember the value captured on the visitor's **first** visit. It's stored and survives internal page navigation, refreshes, and return visits - so if a visitor clicks a paid ad, browses 3 pages, and submits the form, the attribution is preserved from that first ad click. |
| **No**                                | Capture a fresh value on every page load, overwriting any previously stored value. Submission reflects the *current* page context only.                                                                                                                                         |

<Tip>
  Use **First-Touch: Yes** for ad and campaign attribution - this is what marketing teams typically want. Use **First-Touch: No** only when you specifically need to know the *current* page context at the moment of submission.
</Tip>

***

## Fallback Values

The **Fallback** field sets a default value that's submitted when nothing can be captured. Common fallback values:

* `direct` - visitor came directly (typed URL, bookmark, no referrer)
* `organic` - unknown organic source
* `none` - parameter wasn't present
* `unknown` - generic placeholder

Leave Fallback empty if you'd rather submit an empty value when there's nothing to capture.

***

## Examples

### Example 1 - Track Paid Ad Campaigns

Best setup for agencies running Google / Meta / LinkedIn ads:

1. Insert the **URL Source Collector** component
2. Set **Capture** to **UTM Tags**
3. Turn **Google Ads**, **Meta (Facebook)**, and **LinkedIn** toggles **On**
4. Set **First-Touch** to **Yes**
5. Set **Fallback** to `direct`

When a visitor clicks a Google Ad like `?utm_source=google&utm_campaign=spring-launch&gclid=abc123`, every UTM parameter and the `gclid` are sent with the form submission - even if the visitor navigates to a different page before submitting.

### Example 2 - Capture Referring Sites

Track which external sites are driving form submissions:

1. Set **Capture** to **Referrer URL**
2. Set **Field Name** to `referrer`
3. Set **Fallback** to `direct`
4. Set **First-Touch** to **Yes**

Submissions from visitors coming from `example.com/blog-post` include `referrer: https://example.com/blog-post`. Direct visitors submit `referrer: direct`.

### Example 3 - Per-Page Source Tags

Track which landing page or CTA section converts best:

1. On each page's form, insert a separate **URL Source Collector**
2. Set **Capture** to **Custom Value**
3. Set **Field Name** to `page_source`
4. Set **Value** uniquely per page - `homepage-hero`, `pricing-footer`, `blog-cta`, etc.

Each submission includes a `page_source` field telling you exactly which page/slot converted - no URL parameter setup needed.

### Example 4 - Custom Promo Code Capture

Capture a promo code from URLs like `/pricing?promo=SUMMER50`:

1. Set **Capture** to **URL Parameter**
2. Set **Parameter** to `promo`
3. Set **Field Name** to `promo_code`
4. Set **Fallback** to `none`

Submissions include `promo_code: SUMMER50` when the parameter is in the URL, or `promo_code: none` when it isn't.

***

## Using with Integrations

All captured values are submitted as regular form fields - so they automatically work with every integration. You can map them to contact properties, subscriber attributes, or CRM fields using the normal field-mapping flow.

**Common mappings:**

| Captured Field | Integration    | Mapped To                          |
| -------------- | -------------- | ---------------------------------- |
| `utm_source`   | MailerLite     | Custom field `SOURCE`              |
| `utm_campaign` | HubSpot        | Contact property `Campaign`        |
| `gclid`        | HubSpot        | Contact property `Google Click ID` |
| `fbclid`       | Brevo          | Custom attribute `FBCLID`          |
| `referrer`     | Mailchimp      | Merge field `REFERRER`             |
| `page_source`  | ActiveCampaign | Custom field `Page Source`         |

See the [Integrations Overview](/integrations/overview) for platform-specific mapping instructions.

***

## Tips

* **Add as many URL Source Collectors as you need** - each component captures one thing, so if you want to capture multiple data points in the same form, simply add a separate component for each. For example, add one for **UTM Tags**, another for **Referrer URL**, and another for a **Custom Value** - all on the same form. There's no limit.
* **Enable only the ad platforms you run campaigns on** - keeps submissions clean and avoids sending empty click-ID fields.
* **First-Touch: Yes is usually the right choice** for attribution; only disable it if you specifically want current-page context at the moment of submission.
* **The component is invisible to the user** - nothing renders on the form and nothing slows it down.

***

## Next Steps

* [Conditional Logic](/creating-forms/conditional-logic) - add dynamic behavior to form fields
* [Form Fields](/creating-forms/form-fields) - configure the visible fields of your form
* [Integrations Overview](/integrations/overview) - map captured values to your CRM or email platform
