> 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-chatgpt-ads.md).

# Tracking ChatGPT Ads

Connect ChatGPT Ads with an API key and add the Molecule Data UTM parameters to your ads.

**COPY THIS UTM PARAMETERS STRING**

```
?utm_source=openai&utm_medium=paid&utm_campaign={campaign_id}&utm_content={ad_id}
```

Ads Manager replaces the values in curly brackets (`{campaign_id}`, `{ad_id}`) with the real campaign and ad IDs when someone clicks your ad. Copy the string exactly as it is, and don't replace them yourself.

**In OpenAI Ads Manager:**

1. Open the **ad you want to track** and edit its destination URL.
2. Paste your full website URL followed by the UTM parameters string.
3. Save your changes.

Repeat this for every new ad you create.

{% hint style="info" %}
If your website URL already contains a <mark style="color:red;">"?"</mark> sign, start the UTM parameters string with a "&" sign instead.

Instead of `?utm_source=`, use `&utm_source=`.
{% endhint %}

Example:

`https://yourwebsite.com?utm_source=openai&utm_medium=paid&utm_campaign={campaign_id}&utm_content={ad_id}`

## Connecting ChatGPT Ads

ChatGPT Ads connects with an **API key** that you create in OpenAI Ads Manager and paste into Molecule Data. There is no sign-in pop-up.

**Create the API key in Ads Manager:**

1. Open OpenAI Ads Manager at [ads.openai.com](https://ads.openai.com) and sign in.
2. In the left menu, go to **Settings → General**.
3. Scroll down to **API Keys** and click **Create New Key**.
4. Name the key `Molecule` so you can recognise it later.
5. **Copy the key right away** and keep it somewhere safe until you paste it in the next step.

{% hint style="info" %}
You need the **API Keys** section, not **Manage conversion keys**. Conversion keys are for sending purchases to OpenAI and are not used to connect Molecule Data.
{% endhint %}

**Then, connect it in Molecule Data:**

1. Go to **Integrations** and open the **ChatGPT Ads** tile, then click to add an account.
2. Paste the key into **API key** and click **Check key**.
3. Molecule Data shows the ad account the key opens, with its **currency** and **timezone**. Check it is the right account.
4. Click **Connect**.

If you see *"OpenAI did not accept this key"*, make sure you copied the whole key, or create a new one. If you see *"We couldn't reach OpenAI"*, the key may be fine: wait a moment and try again.

Once it is connected, you can turn ChatGPT Ads campaigns, ad groups and ads on or off and change campaign budgets from the Dashboard. How is on the [Dashboard page](https://app.moleculedata.com/docs/dashboards/dashboard#chatgpt-ads) in the app's Docs.

{% hint style="warning" %}
Molecule Data reads your reporting data, and changes your ChatGPT Ads account only when someone on your team turns something on or off or changes a budget in Molecule Data. OpenAI keys currently give full access to the ad account, so treat the key like a password. You can revoke it at any time under **Settings → General → API Keys**; Molecule Data then stops importing ChatGPT Ads data, and can no longer change anything, until you connect a new key.
{% endhint %}
