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

# Microsoft Ads integration

> Connect Microsoft Ads to Cometly to see which campaigns, ad groups and ads produce your leads and sales, and send conversions back to Microsoft.

The Microsoft Ads integration links your Microsoft Advertising (formerly Bing Ads) accounts to Cometly. When you connect Microsoft Ads to Cometly, your campaigns, ad groups and ads come into the Cometly **Ads Manager** with their spend, impressions and clicks.

Cometly can then attribute each conversion to the ad that produced it, so you can compare what a campaign costs with the leads and sales it brings in. You can also send those conversions back to Microsoft through the Conversion API (Cometly's server-side feed of conversions to ad platforms).

## Before you start

* **A Microsoft login that is a user on the ad accounts.** Cometly lists the Microsoft Advertising accounts your user has access to.
* **A sign-in Microsoft accepts.** A work account may need a one-time approval from your Microsoft admin, and an account that signs in to Microsoft Advertising with Google needs extra setup. See [Troubleshooting](#troubleshooting).
* **The Administrator or Advertiser role** in the Cometly space (a space is a workspace inside your Cometly account, usually one per business or client).
* **The Cometly pixel** (the script that tracks visitors on your website) on your landing pages. See [Install the pixel](https://docs.cometly.com/getting-started/install-pixel.md).

## Connect Microsoft Ads

**1. Open the Microsoft Ads row**

In Cometly, click **Integrations** in the left sidebar and find **Microsoft Ads** under **Ad Platforms**.

**2. Sign in with Microsoft**

Click **Sign in with Microsoft**. A pop-up window opens on Microsoft. Sign in and accept the permissions Cometly asks for. The window then shows **Microsoft profile connected successfully.** Click **Done** to close it.

**3. Find your ad accounts**

The row expands and the **Ad Accounts** table lists the accounts your Microsoft user can access. Use **Search ad account** to find one.

**4. Connect each ad account to the space**

In the space the account should report into, click **Connect & Sync Data** next to it. You see **Ad Account Connected - Data will sync in 30-60 minutes**.

## Check it worked

The account now shows **Connected** with the space's name in the **Space** column, and it appears in the **Connected Microsoft Ad Accounts** card, where everyone in the space can see who connected it. Within 30 to 60 minutes, your active Microsoft campaigns start to appear in the **Ads Manager** with their spend.

> [!NOTE]
>
> Your Microsoft sign-in is personal: only you can see and manage it. An ad account can be connected to one space at a time. See [Same ad account in two spaces](https://docs.cometly.com/support/troubleshooting/ad-accounts/same-ad-account-in-two-spaces.md).

## Add Cometly's URL parameters

Microsoft Ads carries Cometly's parameters in a tracking template. Use the one that matches the 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}
```

**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
```

![Setup step 4, Add URL parameters to your ads, with Microsoft Ads selected, showing the two tracking templates, one for Search, Video, Display, Discovery and Shopping and one for Performance Max, each with a Copy Tracking Template button.](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/integrations/ad-platforms/microsoft/02.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=f7e26a3c2619a09bf3fef5da717d1b6f)

Paste the matching template as the tracking template in Microsoft Ads. To copy the templates in Cometly, open **Setup**, step 4 **Add URL parameters to your ads**, choose **Microsoft Ads** under **Select integration** and click **Copy Tracking Template**. The same templates are on [Microsoft Ads URL parameters](https://docs.cometly.com/getting-started/url-parameters.md#microsoft-ads-url-parameters).

> [!WARNING]
>
> Keep `comet_source=bing` exactly as written. Cometly identifies Microsoft Ads traffic by the value `bing`, so do not change it to `microsoft`.

Cometly cannot add the template to Microsoft Ads for you, but it checks your ads on every data refresh:

* It reads the tracking template and the final URL suffix on the ad, ad group, campaign and account, and applies the lowest level that has one. A template on an ad or ad group overrides the campaign's.
* An active ad whose landing page does not receive `comet_source=bing` and `comet_ad_id={AdId}` gets a red dot with the tooltip **UTM Setup Error** in the Ads Manager. Performance Max ads also need `comet_ad_group={AdGroupId}` and `comet_type=smart`.
* To see what each level carries, add the **URL Params** column from the **Columns** menu. An account-level template is shown above the table, next to **Account URL Params:**.

To fix a flagged ad, see [Fix UTM Setup Errors](https://docs.cometly.com/support/troubleshooting/url-parameters/utm-setup-errors.md).

## Send conversions back (Conversion API)

The **Microsoft** section of the Conversion API (**Events Manager**, then the **Conversion API** tab) sends your Cometly events (the conversions Cometly records, such as leads and purchases) to Microsoft Ads as offline conversions. You create offline conversion goals in Microsoft Ads, turn on data sharing, and map each goal to a Cometly event with a rule: **Send all events** or **Only send attributed events**. See [Configure the Microsoft Ads Conversion API](https://docs.cometly.com/guides/conversion-api/microsoft.md).

## What to expect after connecting

* **Data.** Active campaigns start populating within 30 to 60 minutes. After that, Cometly refreshes Microsoft Ads data every 30 minutes and pulls the previous two days again once a day, so Microsoft's later adjustments are captured.
* **Ads Manager.** The level tabs are **Campaigns**, **Ad Sets** and **Ads**: your Microsoft ad groups are on the **Ad Sets** tab. If you have ads management permission, you can turn campaigns, ad groups and ads on or off, rename campaigns and ad groups, and change campaign budgets from Cometly.
* **Campaigns.** New campaigns are picked up automatically while **Auto-track new campaigns** is on (**Settings**, then **Campaign tracking** under **Workspace**). If a campaign that was already running is missing, see [Manually turn on tracking](https://docs.cometly.com/support/troubleshooting/ad-data/manually-turn-on-tracking.md).
* **Status.** The row shows **Connected**, or **Connection Issue, Resync Required** when Cometly cannot load your ad accounts from Microsoft: click **Resync** to sign in again (see [Ad data not syncing](https://docs.cometly.com/support/troubleshooting/ad-data/ad-data-not-syncing.md)). **Last Synced** is the last time Cometly renewed its connection to your Microsoft profile, not the time of the last data refresh.
* **Disconnect.** At the top of the expanded row it removes your Microsoft profile, and ad data stops tracking immediately in every space that uses its ad accounts. Next to one ad account it removes only that account from its space.

## Troubleshooting

### Microsoft shows "Need admin approval"

Your organization restricts third-party apps, and a Microsoft admin has to approve Cometly once. See [Troubleshoot a Microsoft Ads connection](https://docs.cometly.com/support/troubleshooting/ad-data/microsoft-ads-connection.md).

### The sign-in fails and you sign in to Microsoft Advertising with Google

See [Connect Microsoft Ads when your account uses Google sign-in](https://docs.cometly.com/support/troubleshooting/integrations/microsoft-ads-google-sso.md).

### The pop-up says "Microsoft authorization failed"

Microsoft returned an error instead of granting access, and the rest of the message is Microsoft's own reason. Close the window, click **Sign in with Microsoft** again and accept the permissions Microsoft lists.

### You received "Action Required: Resync Microsoft Connection"

Microsoft no longer accepts the sign-in made by the user named in the message, so ad data has stopped for that space. That user clicks **Resync** on the **Microsoft Ads** row and signs in again. Cometly posts this notification in the space and sends it by email. When data flows again you get **Microsoft Connection Restored**, and the last 48 hours of data are restored automatically.

### An ad account is missing from the list

Cometly only lists accounts that your Microsoft user has access to. Ask for access to the account in Microsoft Advertising, then click **Resync**. An account that already shows **Connected** with another space's name must be disconnected there first.

## Frequently asked questions

### Does Cometly work with Bing Ads?

Yes. Bing Ads is the former name of Microsoft Ads, so you connect it through the **Microsoft Ads** row on the **Integrations** page. The URL parameter value is still `comet_source=bing`.

### Can I connect more than one Microsoft Ads account to Cometly?

Yes. The **Ad Accounts** table lists every account your Microsoft user can access, and you click **Connect & Sync Data** on each one you want to track. Each ad account reports into one space at a time, and a space can hold several ad accounts.

### Does Cometly import Microsoft Ads data from before I connected?

No. Cometly tracks a campaign from the moment its tracking is turned on, and from that point forward. For campaigns that were already running, see [Tracking historical ad data](https://docs.cometly.com/support/troubleshooting/ad-data/historical-ad-data.md).

## Next steps

* [Configure the Microsoft Ads Conversion API](https://docs.cometly.com/guides/conversion-api/microsoft.md) to send your conversions back to Microsoft.
* [Review the URL parameters for every ad platform](https://docs.cometly.com/getting-started/url-parameters.md) if you also run ads elsewhere.
* [Explore your ad data in the Ads Manager](https://docs.cometly.com/guides/ads-manager/overview.md).
* [Check how often data updates in Cometly](https://docs.cometly.com/support/troubleshooting/ad-data/data-update-frequency.md).
* [Contact support](https://docs.cometly.com/support/contact.md) with the name of the Microsoft Ads account, the status on the **Microsoft Ads** row and the exact message you see when you try to connect.

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.