> For the complete documentation index, see [llms.txt](https://docs.moleculedata.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.moleculedata.com/tracking-ad-channels/tracking-facebook-ads.md).

# Tracking Meta (Facebook & Instagram) Ads

Add the Molecule Data UTM parameters to your Meta (Facebook & Instagram) ads.

**COPY THIS UTM PARAMETERS STRING**

```
utm_source=social&utm_medium=paid&utm_campaign={{campaign.name}}&utm_term={{adset.name}}&utm_content={{campaign.id}}|{{adset.id}}|{{ad.id}}
```

**In your Meta Ads Manager account:**

1. Click on the **Ads** tab.
2. Select **all active ads**.

<figure><img src="https://1364162697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUc1DhBGYxkrTzRj7xZKQ%2Fuploads%2FRIyjTruC7WFZJickmwBv%2Fselect_ads_bulk.png?alt=media&#x26;token=4ebc6ece-83ad-4a78-8e1c-a8e798685825" alt=""><figcaption><p>Select all active ads</p></figcaption></figure>

3. Click the **"Edit"** button at the top of the menu.
4. **Paste** the UTM string you copied above into the **URL parameters** field.
5. Remove any UTM parameters (keep the actual link) from the **Website URL** field, if you have any there.
6. Click **"Publish"**.

That's all you need to do. All of your ads will now be tracked and correctly attributed in the Molecule Data dashboard.

**Customizing your UTM values**

If you are an advanced UTM user, you may want to keep your existing `utm_source`, `utm_medium`, and `utm_campaign` values consistent with what you have used in the past. That is not a problem for Molecule Data — you can change any of these to your liking:

* utm\_source
* utm\_medium
* utm\_campaign
* utm\_term

For example, the UTM string could look like this:

> utm\_source=**facebook**\&utm\_medium=paid\&utm\_campaign={{campaign.name}}\&utm\_term={{adset.name}}\&utm\_content={{campaign.id}}%7C{{adset.id}}%7C{{ad.id}}

Or like this:

> utm\_source=**facebook**\&utm\_medium=**cpc**\&utm\_campaign={{campaign.name}}\&utm\_term={{adset.name}}\&utm\_content={{campaign.id}}%7C{{adset.id}}%7C{{ad.id}}

**IMPORTANT:**

It is recommended not to change the `utm_content` part. If you need it to be a specific value, that is possible too — in that case, add `&ref={{campaign.id}}%7C{{adset.id}}%7C{{ad.id}}` at the end of your custom UTM string.

An example of that would look like this:

`utm_source=facebook&utm_medium=cpc&utm_campaign={{campaign.name}}&utm_term={{adset.name}}&utm_content=xyz&ref={{campaign.id}}%7C{{adset.id}}%7C{{ad.id}}`

Please stick with one consistent UTM structure, placed in the correct field. Only then can we ensure consistent and accurate campaign / ad set / ad performance tracking in the Molecule Data dashboard.

**IMPORTANT:**

If you already use a UTM template in all of your ads and the `{{ad.id}}` value is present in any of the UTM parameter fields, we can map it automatically in the reporting, so no changes are needed. Please contact our support team if you have any questions.
