# Landing pages and UTM tagging

How to send leads from your own landing page into the Lead app and tag your ad URLs so each lead is tied to its campaign, ad group and ad.

Source: https://support.rework.com/article/ads-landing-pages-and-utm

> **In plain words:** this page shows how to send visitors from your ads to your own web page, and get every form they fill in to land in the Lead app with the ad it came from. **UTM** tags are small labels added to a web link (like `utm_campaign=spring`) that say where a visitor came from. New to ad terms? See [Ads basics](https://support.rework.com/article/ads-basics).

**Where to find it:** Lead app > **Settings** > **Lead sources** (the source), plus the URL settings of each ad inside its ad platform.

**Who can use it:** creating a source in the Lead app needs a Leads admin.

This is route C in [How you run ads decides how you set up](https://support.rework.com/article/ads-choosing-your-setup). The person clicks your ad, leaves the platform and fills in a form on your own page. Attribution (knowing which ad produced which lead) is not automatic here. The ad platform tells Rework nothing, so your page has to.

This works the same way on every platform, because you own the page. It is also the route for **ChatGPT Ads**.

## Before you start

- Have a landing page with a form (or a page builder such as Webflow, Unbounce, Wix, Ladipage or HighLevel).
  
- Have access to the Lead app and to the ad platform where you edit your ads.
  
- Know which Lead service the leads should go to. A **Lead service** is the list in the Lead app where leads are kept.
  

## Create a landing page source in the Lead app

A **source** is the entry in the Lead app that receives leads from one place, here your page.

1. In the Lead app, go to **Settings > Lead sources**, open **Source integrations** and choose **Connect new** (or **Add source**).
   
2. In **Connect integration**, pick the **Service** the leads should go to and give the source a **Name**.
   
3. Choose the type that matches your page builder, then choose **Connect**.
   
   - **Landing pages**: Webflow, Unbounce, Wix, Ladipage, HighLevel.
     
   - **API**: **HTTP API**, a generic JSON webhook for your own site.
     
   - **Connectors**: Zapier, Make, AI Web Capture.
     
4. Open the source. On the **Details** tab, the **API guidelines** block shows **Set up your landing page** steps (for supported page builders), the **Endpoint** (the webhook URL to POST to, with a secret token and a copy button), the **Lead payload** and a **Sample request**.
   

The token identifies both your workspace and the source, so keep it secret. If it leaks, use **Regenerate token** in the **...** menu (or rotate it under **Edit settings > Delivery**). That menu also has **Disconnect** and **Remove**. To copy the endpoint, use the copy button next to it.

![Lead app, a landing page source dialog on the Details tab](https://storage.googleapis.com/reworkv3-public/success/261009/yHnYCxPFlwx4m7CBD1irQhHjkAjUpWuVmU8MrwE2k1Yxz7krenPxFWqccbizSlg3/img.CIDV3x70oZFZRIK7cFS7KBPmaT9q1t7imfqnRZBYop4redQNjeH1FItOOql1dpzZ.png)

For the full reference, see [Connecting sources](https://support.rework.com/article/lead-connecting-sources) and [Channels and attribution](https://support.rework.com/article/lead-channels-and-attribution).

## Make the page post to the endpoint

1. Set your page or form tool to **POST** to the endpoint when someone submits. JSON and form-encoded both work.
   
2. In the Lead app, open the source's **Transform fields** tab.
   
3. Map each incoming key to a Lead field. **Auto Map Fields** helps, and **Validate** checks the result. Keys with spaces need underscores instead.
   

![Lead app, the source's Transform fields tab](https://storage.googleapis.com/reworkv3-public/success/261009/pSKbTuvOg9ETaPRQW9zqgGEQpZvaJT64TMl5Gyd4LiGb2cIcTtDbkQqUFhqdTFHi/img.K6yZABEeZfMhxuwhejeYYjjid1Zfs6Eff9JsUwKie5dgDMhuYBqz3bzg4z9QmuQk.png)

## Make the page post the full URL back

Rework reads the tracking keys from a `link` (or `referral_url`) field. If your page only posts the form answers and not the URL it was on, every parameter from the tagging step is lost.

1. Add a hidden field to the form that carries `window.location.href`. In a page builder, use its "page URL" value.
   
2. Name the field `referral_url`.
   

## Tag the ad URL

This is the step people skip. In the ad platform, fill in the **URL parameters** (or tracking template) of your ads using its dynamic macros. A **macro** is a placeholder such as `{{campaign.id}}` that the platform replaces with the real value at click time, so the real campaign, ad group and ad ids travel along with the link.

### Which keys Rework reads

Rework reads these keys from the landing page URL. Anything else in the URL is ignored.

| 
Key

 | 

What it fills

 |
| --- | --- |
| 

`meta_ad_campaign_ext_id`

 | 

The Meta campaign

 |
| 

`meta_ad_group_ext_id`

 | 

The Meta ad set

 |
| 

`meta_ad_ext_id`

 | 

The Meta ad

 |
| 

`gad_campaignid`

 | 

The Google campaign

 |
| 

`gad_adgroupid`

 | 

The Google ad group

 |
| 

`fbclid`, `gclid`, `ttclid`, `li_fat_id`, `oppref`

 | 

The click IDs for Meta, Google, TikTok, LinkedIn and ChatGPT

 |
| 

`fbp`

 | 

The Meta browser ID

 |
| 

`utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`

 | 

The standard UTM fields, saved on the lead

 |

A **click ID** is a code the platform adds to the link on each click. Rework uses it to match the lead back to the platform.

### Meta

1. In Meta Ads Manager, open the ad and go to the **Tracking** area (below the destination).
   
2. Under the website URL, choose **Create a URL parameter** (the **URL parameters** box).
   
3. Paste:
   

```
meta_ad_campaign_ext_id={{campaign.id}}&meta_ad_group_ext_id={{adset.id}}&meta_ad_ext_id={{ad.id}}
```

1. Publish the ad.
   

Meta also adds `fbclid` to the link on its own. Meta help: [Add URL parameters to your Meta ads](https://www.facebook.com/business/help/1016122818401732).

### Google Ads

Google appends a `gclid` when **auto-tagging** is on. Keep it on:

1. In Google Ads, click **Admin**, then **Account settings**.
   
2. Open **Auto-tagging** and tick **Tag the URL that people click through from my ad**.
   
3. Click **Save**.
   

Google help: [About auto-tagging](https://support.google.com/google-ads/answer/3095550).

Google also adds `gad_source` and `gad_campaignid` to the final URL of its ads on its own, so the campaign usually arrives without any setup. Google help: [About gad\_\* URL parameters](https://support.google.com/google-ads/answer/16193746). Google's page does not list an ad group id parameter, so to send the ad group, add this to the **Final URL suffix**:

```
gad_adgroupid={adgroupid}
```

- To set it at account level: **Admin**, **Account settings**, **Tracking template**, type the text in **Final URL suffix**, **Save**.
  
- For one campaign: **Campaigns**, **Settings** tab, click the pencil in the **Tracking template** column, fill **Final URL suffix**, **Save**.
  

Google help: [Add a Final URL suffix](https://support.google.com/google-ads/answer/9054021). If you also want `gad_campaignid={campaignid}` as a fallback, add it the same way.

`{campaignid}`, `{adgroupid}` and `{creative}` (Google's ad id) are Google's ValueTrack parameters. Google help: [Set up tracking with ValueTrack parameters](https://support.google.com/google-ads/answer/6305348). Rework has no key for a Google ad id, so use `utm_content={creative}` if you want it saved on the lead.

### TikTok Ads

TikTok's macros are `__CAMPAIGN_ID__` (campaign), `__AID__` (ad group) and `__CID__` (creative). Rework has no campaign id key for TikTok, so add them as UTM fields, which are saved on the lead:

```
utm_campaign=__CAMPAIGN_ID__&utm_term=__AID__&utm_content=__CID__
```

To add them: in TikTok Ads Manager open the ad, go to **Ad details**, and fill the URL parameters (UTM) fields or the custom parameters box. TikTok help: [How to add URL parameters to your website URL](https://ads.tiktok.com/help/article/how-to-add-url-parameters-to-your-website-url-in-tiktok-ads-manager), [supported macros](https://ads.tiktok.com/help/article/about-supported-macros-for-mobile-measurement-partners).

TikTok adds `ttclid` itself, in the form `&ttclid=...`, without disturbing your other parameters. TikTok help: [About TikTok Click ID](https://ads.tiktok.com/resources/help/article/tiktok-click-id). The click id is what Rework uses to match the lead back to the platform.

### LinkedIn Ads

LinkedIn adds `li_fat_id` when its insight tag is on your page. For ad ids, use LinkedIn's URL tracking parameters in Campaign Manager: open the account or campaign, find the URL tracking parameters field, and add dynamic values in double curly brackets and capital letters, with `&` between them, for example:

```
utm_campaign={{CAMPAIGN_ID}}&utm_content={{CREATIVE_ID}}
```

Dynamic parameters can be set at account or campaign level. LinkedIn help: [URL tracking parameters in Campaign Manager](https://www.linkedin.com/help/lms/answer/a5968064), [Dynamic UTM tracking](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/dynamic-utm-tracking).

Rework has no LinkedIn campaign id key, so these values are saved as UTM fields on the lead, and the `li_fat_id` is what matches the lead back.

### ChatGPT Ads

ChatGPT adds its click reference `oppref` to the landing URL. Keep it on the link, and make sure your page posts the full URL back (see [Make the page post the full URL back](#make-the-page-post-the-full-url-back)), because Rework reads `oppref` from it.

ChatGPT Ads also lets you add a query string template with macros at campaign, ad group or ad level:

```
utm_source=openai&utm_campaign={campaign_id}&utm_content={ad_id}
```

`{campaign_id}`, `{ad_group_id}` and `{ad_id}` are the macros OpenAI lists. Rework has no ChatGPT campaign key, so they are saved as UTM fields on the lead. OpenAI help: [Campaign management](https://developers.openai.com/ads/campaign-management), [Measurement pixel](https://developers.openai.com/ads/measurement-pixel).

## What is captured for you

No tagging is needed for these:

- **Referral URL** (`referral_url`) and **referral domain** (`referral_domain`)
  
- **IP location** (`geo_ip`)
  
- The `utm_*` fields and click IDs, whenever they are in the URL you posted
  

## Check it before you spend money

1. Send one test submission through the live ad URL, not a copy-pasted page address.
   
2. Open the new lead in the Lead app.
   
3. Check field by field: your answers, the referral URL, the click ID and the campaign, ad group and ad.
   
4. After the next stats sync, check the campaign's **Leads** column in AdManager. See [Connecting to the Lead app](https://support.rework.com/article/ads-connecting-to-other-apps).
   

## Keep it working

- Re-check the tagging after a campaign is duplicated. Duplicating usually keeps the URL parameters, but rebuilding an ad from scratch does not.
  
- When the page changes and a field is renamed, update the mapping on the source's **Transform fields** tab.
  
- Protect the form from spam. A public webhook behind an unprotected form is an open invitation.
  

## Troubleshooting

| 
Problem

 | 

Why it happens

 | 

What to do

 |
| --- | --- | --- |
| 

Leads arrive perfectly, but **Leads** stays at zero

 | 

The ad has no URL parameters (the classic route C failure)

 | 

Add the macros from the tagging section to every ad

 |
| 

Same result, and the parameters are on the ad

 | 

The page does not post the URL back

 | 

Add the hidden `referral_url` field

 |
| 

Parameters disappear on the way

 | 

A redirect or link shortener strips the query string

 | 

Link straight to the page

 |
| 

Every lead is attributed to one ad

 | 

Hard-coded values were used instead of macros

 | 

Replace them with the platform's macros

 |
| 

Answers land in the wrong field or disappear

 | 

Wrong field keys

 | 

Fix the mapping on the **Transform fields** tab

 |
| 

Submissions are rejected

 | 

The source is disabled, or the token is wrong

 | 

Enable the source and check the endpoint's token

 |
| 

A new ad has no tags

 | 

It was rebuilt from scratch

 | 

Add the URL parameters to the new ad

 |

More in [Fix it by symptom](https://support.rework.com/article/ads-fix-by-symptom) and [Common errors](https://support.rework.com/article/ads-common-errors).
