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

# Ad Click ID Tracking via Morf Forms

> Use URL parameters and Morf Forms hidden fields to persist Google and Facebook click IDs through to your form submissions.

By following these steps, you ensure click IDs are correctly captured in your form submissions for accurate ad attribution.

## 1. Add Hidden Fields in Feathery

1. Open your form and go to **Settings > Data Tracking > Edit Hidden Fields**.
2. Add hidden fields with the exact IDs for the platforms you are using:
   * `gclid`
   * `fbclid`
3. Save and **Publish** your form.

[See Feathery's docs on setting field values from URL params.](https://docs.feathery.io/platform/form-fields/set-field-values)

## 2. Google Ads: Appending `gclid`

### Option A: Auto-Tagging

1. In Google Ads, go to **Settings > Account Settings > Auto-tagging**.
2. Check **"Tag the URL that people click through from my ad"**.

Google Ads will automatically append `?gclid=XYZ` to your final URLs. When users land on your Feathery form, Feathery will detect and populate the `gclid` hidden field from the query parameter.

[Learn more about auto-tagging.](https://support.google.com/google-ads/answer/9054021)

### Option B: Final URL Suffix or Tracking Template

1. Sign in to Google Ads and open your campaign.
2. Go to **Settings > Advanced settings > Campaign URL options**.
3. In **Final URL suffix**, enter:

```
gclid={gclid}
```

Google will append `?gclid=CLICK_ID` (or `&gclid=CLICK_ID`) to your ad URLs.

Optionally, use a **Tracking Template** instead:

```
{lpurl}?gclid={gclid}&utm_source=google&utm_medium=cpc&utm_campaign={campaignid}
```

`{lpurl}` expands to your ad's Final URL; other placeholders fill at click time.

> [accordion] When to use Option A vs. Option B
>
> **Use Auto-Tagging (Option A) when:**
>
> * You primarily rely on Google Analytics or Google Ads reports for attribution.
> * You don't need to control or combine the click ID with other URL parameters.
> * You want a zero-maintenance setup.
>
> **Use Final URL Suffix / Tracking Template (Option B) when:**
>
> * You need multiple parameters (e.g. `utm_source`, `campaign`, `gclid`) in a specific order.
> * You're using a non-Google analytics platform or a mix of tools with custom UTM naming.
> * You want different URL-parameter strategies across ad groups or individual ads.

## 3. Facebook Ads: Appending `fbclid`

Facebook automatically appends `?fbclid=…` to destination URLs on ad clicks. Ensure your Feathery form URL accepts unknown query parameters so it arrives as:

```
https://form.feathery.io/to/<your-form-slug>/?fbclid=IwAR2F4…
```

If your form host strips unknown params, explicitly set URL parameters in Ads Manager under **Tracking > URL Parameters**:

```
fbclid={fbclid}
```

[Learn more about Facebook URL parameters.](https://www.facebook.com/business/help/1016122818401732)

## 4. Combined URL Setup

Example URL where both `fbclid` and `gclid` are collected:

```
https://form.feathery.io/to/<your-form-slug>/?gclid={gclid}&fbclid={fbclid}
```

* **Google Ads** → Final URL suffix: `gclid={gclid}`
* **Facebook Ads** → URL parameters: `fbclid={fbclid}`

## 5. Verification

### Google Ads

1. In Google Ads, go to your campaign's **Ads & extensions** and create a draft ad pointing at your Feathery form URL. Leave it as a draft or pause the ad group.
2. Click the **Ad Preview & Diagnosis** icon (🔍) in the top-right corner.
3. Enter a keyword from your draft ad and click the ad headline in the preview pane.
4. You'll land on your Feathery form URL with `?gclid=…` appended.
5. Submit the form, then check Feathery's **Results** tab to verify the `gclid` field captured the previewed click ID.

### Facebook Ads

1. In Ads Manager, create a draft ad. Set the **Website URL** to your Feathery form and add `fbclid={fbclid}` under **Tracking > URL Parameters**. Do not activate or publish.
2. In the Ads table, check the box next to your draft ad and click **Preview > Facebook Feed**.
3. In the preview pane, click the **Share** icon and copy the link. Paste it into a new browser tab.
4. Your form URL will include `?fbclid=IwAR…` in the address bar.
5. Submit the form, then check Feathery's **Results** tab to confirm the `fbclid` field captured the click ID.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.