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

# Set up URL parameters for all channels

> Set up URL parameters for your ads, emails, SMS and custom links so Cometly can tie every click, lead and sale to the source that produced it.

URL parameters are short tags added to the end of a link, such as `comet_source` and `comet_ad_id`. When someone clicks your ad, email or post, the tags tell Cometly which source, and which ad, the click came from.

This is what lets Cometly attribute (tie back) each lead and sale to the ad or channel that produced it. With the parameters in place, your reports show which ads bring in customers, so you can decide where to spend more and what to turn off.

## Start here

Set up URL parameters on your ads, emails, SMS and custom sources so Cometly can attribute your events to the right source. Choose what you want to configure:

* [Meta Ads](#meta-ads-url-parameters)
* [Google Ads](#google-ads-url-parameters)
* [TikTok Ads](#tiktok-ads-url-parameters)
* [LinkedIn Ads](#linkedin-ads-url-parameters)
* [Pinterest Ads](#pinterest-ads-url-parameters)
* [Snapchat Ads](#snapchat-ads-url-parameters)
* [X Ads](#x-ads-url-parameters)
* [Reddit Ads](#reddit-ads-url-parameters)
* [Taboola Ads](#taboola-ads-url-parameters)
* [AdRoll Ads](#adroll-ads-url-parameters)
* [Microsoft Ads](#microsoft-ads-url-parameters)
* [Whop Ads](#whop-ads-url-parameters)
* [ChatGPT Ads](#chatgpt-ads-url-parameters)
* [Email](#email-url-parameters)
* [SMS](#sms-url-parameters)
* [Social organic](#social-organic-url-parameters)
* [Custom sources](#custom-tracking-url-parameters)

You can copy every template on this page from Cometly: in the left sidebar click **Setup**, open step 4, **Add URL parameters to your ads**, choose a platform under **Select integration** and click **Copy Parameters** (for Google Ads and Microsoft Ads, **Copy Tracking Template**).

> [!NOTE]
>
> The parameters need to be added to each new ad you create, not just the ads you have today. Adding them every time you launch keeps your attribution accurate.

## Meta Ads URL parameters

[How to set up URL parameters for Meta](https://www.loom.com/embed/6da5dec070d847e8bc31023c0f2fda08)

> [!TIP]
>
> When you update your ad's parameters, the ad goes back into review for a very short time. **Updating URL parameters is not considered a significant edit, so learning is not reset on your ads.** See [Meta's article on significant edits](https://www.facebook.com/business/help/316478108955072?id=561906377587030) for what does reset learning.

These URL parameters are required on every Meta ad you want to track with Cometly:

```text theme={null}
comet_source={{site_source_name}}&comet_ad_id={{ad.id}}&comet_placement={{placement}}
```

At the ad level in Meta Ads Manager, go to the **Tracking** section and paste the parameters into the **URL parameters** box.

We recommend the **URL parameters** box in the Tracking section. As an alternative, you can put the parameters on the **Website URL** instead.

If you have a link in your ad copy, do not put the parameters on the Website URL, because a click on the link in your ad copy will not carry them. Only use the Website URL when there is no link in your ad copy.

> [!WARNING]
>
> Put the parameters in the URL parameters box or on the Website URL, never both. They must be in one place only.

### Append to existing URL parameters on your ads

If you already have parameters in the **URL parameters** box, append the Cometly parameters with an `&` sign, as in this example:

![Meta URL parameters box with utm parameters followed by the Cometly parameters joined by an ampersand](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/getting-started/url-parameters/02.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=c6ef3e96b9e90385e74abc09ebc64f61)

If you already have parameters on your **Website URL**, append the Cometly parameters with an `&` sign, as in this example:

![Meta Website URL field with existing utm parameters followed by the Cometly parameters](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/getting-started/url-parameters/03.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=95c16bf15160550839dbd9ad5d83686b)

### Append parameters to a URL with a product variant

> [!WARNING]
>
> If there is already a `?` in your Website URL (for example a [variant in your URL](https://docs.cometly.com/guides/url-parameters/urls-with-variant-parameter.md)), the URL already has parameters, so start the Cometly parameters with `&` instead of `?` when you add them to the end.

**Example:**

If your Website URL is:

```text theme={null}
www.test.com?variant=123456
```

Add:

```text theme={null}
&comet_source={{site_source_name}}&comet_ad_id={{ad.id}}&comet_placement={{placement}}
```

Your final Website URL looks like this:

```text theme={null}
www.test.com?variant=123456&comet_source={{site_source_name}}&comet_ad_id={{ad.id}}&comet_placement={{placement}}
```

After you have added the Cometly parameters, publish your ads.

## Google Ads URL parameters

> [!WARNING]
>
> Cometly cannot track Google experimental campaigns.

[Setting up URL parameters in Google Ads with Cometly](https://www.loom.com/embed/fc1449e0419d4100932ee11c77a10526)

> [!NOTE]
>
> Google Ads applies tracking templates in this order of priority: ad level, ad group level, then campaign level. A tracking template at the ad or ad group level overrides your campaign-level template, which can cause tracking issues.

Before you begin, make sure no other tracking template is set at the ad group or ad level for the campaigns you want to track. See [Check the ad group or ad level for other tracking templates](https://docs.cometly.com/support/troubleshooting/url-parameters/google-tracking-template-ad-group-level.md).

Every Google campaign you want to track needs a Cometly tracking template. Use the template that matches the campaign type.

### Cometly Google tracking templates

Paste the matching template into the **Tracking template** field of each campaign.

**Campaign type: Search, Display, Discovery, Demand Gen, Shopping**

```text theme={null}
{lpurl}?comet_source=google&comet_network={network}&comet_campaign={campaignid}&comet_ad_group={adgroupid}&comet_ad_id={creative}&comet_keyword={keyword}
```

**Campaign type: Performance Max**

```text theme={null}
{lpurl}?comet_source=google&comet_network={network}&comet_campaign={campaignid}&comet_ad_group={adgroupid}&comet_ad_id={creative}&comet_keyword={keyword}&comet_type=smart
```

**Campaign type: Video**

```text theme={null}
{lpurl}?comet_source=google&comet_network=ytv&comet_campaign={campaignid}&comet_ad_group={adgroupid}&comet_ad_id={creative}&comet_keyword={keyword}
```

### Add the tracking template in Google Ads

**1. Open your campaigns**

In Google Ads, go to **Campaigns > Campaigns > Campaigns**.

**2. Select the campaigns and open Settings**

Select the campaigns you want to add the template to, then click **Settings**.

> [!TIP]
>
> Each campaign type has its own template, so filter by campaign type first. That way you put the right template on the right campaigns.

**3. Click Edit**

Select the campaigns again, then click **Edit**.

**4. Choose Change tracking templates**

In the Edit menu, select **Change tracking templates**.

**5. Paste the template and apply**

Paste the Cometly tracking template and click **Apply**.

### Append to an existing tracking template

You can have a tracking template at both the campaign and the ad group level if you need to. Append the Cometly parameters to your existing template.

**Example:** your campaign or ad group currently has this template:

```text theme={null}
{lpurl}?utm_campaign=youtube&utm_content=ad1
```

Append the Cometly parameters like this:

```text theme={null}
{lpurl}?utm_campaign=youtube&utm_content=ad1&comet_source=google&comet_network={network}&comet_campaign={campaignid}&comet_ad_group={adgroupid}&comet_ad_id={creative}&comet_keyword={keyword}
```

## TikTok Ads URL parameters

**1. Open Build URL parameters**

On your ad's page in TikTok Ads Manager, go to the **Ad Details** section. Under **URL**, click **Build URL parameters**.

![TikTok Edit ad page with a box and arrow on the Build URL parameters link under the URL field](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/getting-started/url-parameters/09.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=18e65a044932f7fcae2d92668a2e628f)

**2. Add the custom parameters**

Under **Custom parameters**, add these two parameters and click **Apply**:

* `comet_source` = `tiktok`
* `comet_ad_id` = `__CID__`

![TikTok Build URL parameters dialog with comet\_source and comet\_ad\_id entered under Custom parameters](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/getting-started/url-parameters/10.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=65d6b0bb45d92e6d17f3d0f09159c5be)

**3. Save the ad**

Back on the **Edit ad** page, click **Save**.

![TikTok Edit ad page showing the URL with Cometly parameters and an arrow on the Save button](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/getting-started/url-parameters/11.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=0ccd59e5294d4f9e34cf4d0ffdb3b09b)

> [!WARNING]
>
> If there is already a `?` in your website URL, the URL already has parameters, so start the Cometly parameters with `&` instead of `?`.

For example, if your website URL is:

```text theme={null}
www.test.com?variant=12345667
```

then instead of:

```text theme={null}
?comet_source=tiktok&comet_ad_id=__CID__
```

add:

```text theme={null}
&comet_source=tiktok&comet_ad_id=__CID__
```

so your final website URL is:

```text theme={null}
www.test.com?variant=12345667&comet_source=tiktok&comet_ad_id=__CID__
```

Now you can publish your ad. Use this setup on every ad so Cometly can attribute your TikTok ads correctly.

## LinkedIn Ads URL parameters

At the Campaigns level in LinkedIn Campaign Manager, go to **URL tracking parameters** and add (or append) the URL parameters below. Save your changes after you add them.

![LinkedIn Campaign Manager URL tracking parameters page with the Cometly parameters in the account tracking field](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/getting-started/url-parameters/12.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=40607750c889c456ad3c8479c04c4212)

> [!NOTE]
>
> LinkedIn [updated the names of its dynamic parameters in October 2025](https://www.linkedin.com/help/lms/answer/a5968064). If your LinkedIn ad account was created before October 2025, use the legacy parameters. If it was created after October 2025, use the new parameters.

**Legacy LinkedIn parameters (accounts created before October 2025):**

```text theme={null}
comet_ad_id={{CREATIVE_ID}}&comet_campaign={{CAMPAIGN_ID}}&comet_source=linkedin
```

**New LinkedIn parameters (accounts created after October 2025):**

```text theme={null}
comet_ad_id={{AD_ID}}&comet_campaign={{AD_SET_ID}}&comet_source=linkedin
```

If you already have parameters in place, append the Cometly parameters. For example, if you currently have:

```text theme={null}
utm_source=linkedin
```

append the Cometly parameters (use the set of dynamic parameters that matches your account):

```text theme={null}
utm_source=linkedin&comet_ad_id={{AD_ID}}&comet_campaign={{AD_SET_ID}}&comet_source=linkedin
```

## Pinterest Ads URL parameters

Add these URL parameters to the end of the **Destination URL** on your Pinterest ads:

```text theme={null}
?comet_source=pinterest&comet_ad_id={adid}
```

## Snapchat Ads URL parameters

Place these URL parameters on your Snapchat ads:

```text theme={null}
comet_source=snapchat&comet_ad_id={{ad.id}}
```

## X Ads URL parameters

Place these URL parameters on your X ads:

```text theme={null}
comet_source=x&comet_campaign={{campaign_id}}&comet_ad_group={{adgroup_id}}&comet_ad_id={{ad_id}}
```

## Reddit Ads URL parameters

Place these URL parameters on your Reddit ads:

```text theme={null}
comet_source=reddit&comet_ad_id={{AD_ID}}
```

## Taboola Ads URL parameters

Place these URL parameters on your Taboola ads:

```text theme={null}
comet_source=taboola&comet_campaign_id={campaign_id}&comet_ad_id={site_id}
```

## AdRoll Ads URL parameters

Place these URL parameters on your AdRoll ads:

```text theme={null}
comet_source=adroll&comet_campaign=[CAMPAIGN_EID]&comet_ad_group=[ADGROUP_EID]&comet_ad_id=[AD_EID]
```

## Microsoft Ads URL parameters

Use the tracking template that matches the campaign type.

**Campaign type: Search, Video, Display, Discovery, Shopping**

```text theme={null}
{lpurl}?comet_source=bing&comet_network={Network}&comet_campaign={CampaignId}&comet_ad_group={AdGroupId}&comet_ad_id={AdId}&comet_keyword={keyword}
```

**Campaign type: Performance Max**

```text theme={null}
{lpurl}?comet_source=bing&comet_network={Network}&comet_campaign={CampaignId}&comet_ad_group={AdGroupId}&comet_ad_id={AdId}&comet_keyword={keyword}&comet_type=smart
```

## Whop Ads URL parameters

Whop Ads tracking is fully automatic. There is nothing to paste: the Cometly parameters are applied to each Whop ad for you. See [Whop Ads](https://docs.cometly.com/integrations/ad-platforms/whop.md).

## ChatGPT Ads URL parameters

Place these URL parameters on your ChatGPT ads, or let Cometly add them for you:

```text theme={null}
comet_source=chatgpt&comet_campaign={campaign_id}&comet_ad_group={ad_group_id}&comet_ad_id={ad_id}
```

See [ChatGPT Ads](https://docs.cometly.com/integrations/ad-platforms/chatgpt-ads.md) for each way to add them.

## Email URL parameters

Append this URL parameter to the links in your emails:

```text theme={null}
comet_source=email
```

See [Use the Cometly email URL parameters](https://docs.cometly.com/guides/url-parameters/email.md).

## SMS URL parameters

Append this URL parameter to the links in your SMS messages:

```text theme={null}
comet_source=sms
```

See [Use the Cometly SMS URL parameters](https://docs.cometly.com/guides/url-parameters/sms.md).

## Social organic URL parameters

To attribute organic traffic from social platforms like Instagram and Facebook accurately, append a URL parameter to your links. This identifies the source of the traffic and reduces "No Source" in your reports.

By default, Cometly tracks the referrer from social platforms. But the referrer is not always passed correctly. For example, when someone clicks a link inside the Instagram or Facebook app, the referrer may be recorded as your own website instead of the social platform, because these apps do not pass referrer information reliably. Adding a URL parameter makes sure the traffic source is always tracked.

### How to append the parameters

| Platform | Where to put the link | Link to use | Attributed to |
| - | - | - | - |
| Instagram | Your bio link | `https://yourwebsite.com?comet_source=ig` | Instagram Organic |
| YouTube | Your page's website URL | `https://yourwebsite.com?comet_source=youtube` | YouTube Organic |
| Facebook | Your page's website URL | `https://yourwebsite.com?comet_source=fb` | Facebook Organic |
| X | Your page's website URL | `https://yourwebsite.com?comet_source=x` | X Organic |
| LinkedIn | Your page's website URL | `https://yourwebsite.com?comet_source=linkedin` | LinkedIn Organic |
| Pinterest | Your page's website URL | `https://yourwebsite.com?comet_source=pinterest` | Pinterest Organic |

## Custom tracking URL parameters

To track a custom source in your reports, put the name of the source in the `comet_custom` parameter and add it to the end of your link. Then use the URL Parameters filter in Report Builder to filter by it.

```text theme={null}
comet_custom=XXXXXXXXXX
```

## Check it worked

For your ads, open [Tracking Health](https://docs.cometly.com/getting-started/tracking-health.md) and look at the **URL Parameters** check. It passes when no active ad in an active, tracked campaign has a URL parameter error, and step 4 of **Setup**, **Add URL parameters to your ads**, then shows as complete. After you connect an ad account, the check waits about 2 hours while the first ad data syncs.

If ads still have errors, step 4 lists each affected platform with its number of ads.

## Frequently asked questions

### Why does Cometly show a UTM Setup Error on my ads?

A red dot with the tooltip **UTM Setup Error** in the Ads Manager means at least one active ad is missing the Cometly URL parameters or has them set up incorrectly. Copy the parameters again from step 4 of **Setup** and compare them with what is on the ad. [Fix UTM Setup Errors](https://docs.cometly.com/support/troubleshooting/url-parameters/utm-setup-errors.md) walks through the checks for each platform.

### How long does it take for Cometly to pick up URL parameter changes?

Cometly reads your ads' parameters each time it refreshes your ad data, so a change does not show right away. Allow up to 1 hour for the next data refresh before you troubleshoot further.

### What happens to clicks that don't have Cometly URL parameters?

The click does not carry the information Cometly needs to attribute it to that ad. Cometly still tracks the referrer (the site the visitor came from), but the referrer is not always passed correctly, so some of that traffic can show as "No Source" in your reports.

## Next steps

* [Create and set up your events](https://docs.cometly.com/getting-started/events.md)
* [Check your setup in Tracking Health](https://docs.cometly.com/getting-started/tracking-health.md)
* [Fix UTM Setup Errors on your ads](https://docs.cometly.com/support/troubleshooting/url-parameters/utm-setup-errors.md)
* [Add parameters to URLs that already have a variant parameter](https://docs.cometly.com/guides/url-parameters/urls-with-variant-parameter.md)
* [Track custom sources with a custom URL parameter](https://docs.cometly.com/guides/url-parameters/custom-sources.md)

Still have questions or need a hand? We're happy to help. Reach our team at [support@cometly.com](mailto:support@cometly.com).


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