> ## 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.

# Apply URL parameters to a URL that contains a variant parameter

> Add URL parameters to a variant URL by starting Cometly's parameters with & instead of ?, so clicks on Shopify variant links stay attributed.

URL parameters are the tags you add to the links in your ads so Cometly knows which ad sent each visitor. Some links already carry a parameter of their own, such as the `variant` that Shopify adds to a product page. This page shows how to add URL parameters to a variant URL without breaking the link.

It matters because a URL can only have one `?` symbol. When the Cometly parameters are joined on correctly, every click still carries them, so you can see which ad produced each lead and sale.

[How to apply URL parameters to a URL that contains a variant parameter video](https://www.loom.com/embed/9b550b8aaf384794b240661482e804d9)

## Add URL parameters to a variant URL

When you edit one of your ads, you may find that its Website URL already uses URL parameters. You can tell by a `?` symbol anywhere in the Website URL. The most common one on Shopify is `variant`, which appears when your product has multiple versions, for example different sizes or colors.

If your product page uses a variant, adjust the Cometly URL parameters so that the URL does not contain more than one `?` symbol. Instead of pasting the parameters with a `?` at the start, paste them with a `&` at the start.

## Example

If the Website URL on your Meta ad is:

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

then instead of adding:

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

add:

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

So your final Website URL is:

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

Once the parameters are set up correctly for the variant URL, you can publish your ad.

The example uses the Meta Ads parameters. The same rule applies to any platform where you paste the parameters onto the end of a URL. You find the parameters for each platform in Cometly under **Setup**, step 4 **Add URL parameters to your ads**.

## Check it worked

Look at the final Website URL on your ad: it has one `?` symbol, and the Cometly parameters follow the variant after an `&`.

Then, in the Cometly Ads Manager, select your Meta or TikTok ad account, open the **Columns** menu and choose the preset **Tracking Status**. On the **Ads** tab, the **Tracking Status** column shows **Normal** for the ad, and the **Ad Links** and **URL Params** columns show what the ad carries. Allow up to 1 hour for the next data refresh before the change shows.

## Frequently asked questions

### Should I put Cometly parameters on the Website URL or in the URL parameters box on Meta?

Cometly recommends the **URL parameters** box in the **Tracking** section of your Meta ad. The Website URL is an alternative, and only when there is no link in your ad copy, because a click on that link does not carry the parameters. Use one place or the other, never both.

### Why do I still see a UTM Setup Error after I fixed the URL?

Cometly reads your ads' parameters each time it refreshes your ad data, so a fix does not show right away. The red dot in the Ads Manager stays until the next data refresh. Allow up to 1 hour before you troubleshoot further.

### Do I need to add the parameters to every new ad?

Yes. The parameters need to be added to each new ad you create, not just the ads you have today. If the new ad's Website URL contains a variant, start the parameters with `&` again.

## Next steps

* [Set up URL parameters for all channels](https://docs.cometly.com/getting-started/url-parameters.md)
* [Add URL parameters to Meta carousel ads](https://docs.cometly.com/guides/url-parameters/meta-carousel-ads.md)
* [Fix UTM Setup Errors](https://docs.cometly.com/support/troubleshooting/url-parameters/utm-setup-errors.md)
* [See how often ad data updates](https://docs.cometly.com/support/troubleshooting/ad-data/data-update-frequency.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.