Connect Microsoft Ads
Ledion uploads offline conversions to Microsoft Advertising, matched on the Microsoft click ID, email or phone. You create an offline conversion goal in Microsoft Advertising, sign in from Ledion, and pick the account and the goal.
Before you start
- Ledion installed in HubSpot (Install Ledion).
- The Microsoft account you use for Microsoft Advertising (work, school or personal), with access to the ad account.
- Auto-tagging of the Microsoft click ID (MSCLKID) on. Microsoft turned it on for eligible accounts in April 2024. Check that it’s on in yours.
- 2 hours between creating a goal and the first upload to it.
1. Create an offline conversion goal
In Microsoft Advertising, create a conversion goal of type Offline conversion in the ad account you’ll connect, or use one you have. Ledion lists the account’s active offline goals for you to pick from.
| Setting | What to choose |
|---|---|
| Name | One you’ll keep, like “Closed won (Ledion)”. Up to 100 characters. |
| Revenue | Let the value vary per conversion. Ledion sends each record’s amount. When a send has no value, Microsoft uses the goal’s own revenue settings. |
| Conversion window | Up to 90 days. Microsoft’s default is 30 days. If your deals take longer than that from click to close, use 90. |
| Enhanced conversions | On. Ledion sends a hashed email and phone with each conversion. |
Wait 2 hours after creating the goal before the first upload. Conversions show in Microsoft’s reporting within 6 hours of an upload.
Screenshot to come: Microsoft Advertising, new conversion goal: Offline conversion type, with the name, revenue, conversion window and enhanced conversions settings
2. Connect Microsoft Ads in Ledion
- In Ledion, open Connections, add Microsoft Ads, check Sending to Microsoft Ads (the confirmation that Ledion may send Microsoft Ads each conversion your workflows send) and click Connect Microsoft. Microsoft’s sign-in opens in a new tab.
- Choose the Microsoft account you use for Microsoft Advertising, and allow Ledion’s access.
- A page says “Connected to Microsoft Ads.” Close the tab, go back to HubSpot and click I’ve connected, refresh.
- Pick the ad account under Account and click Use this account. Until you do, the connection shows Pick an account. If you’re an agency, accounts linked to your manager account are in the list too.
- When you create a conversion, pick the goal in its Microsoft Ads row.
Screenshot to come: Ledion's Connections page after the Microsoft sign-in: the Microsoft Ads connection in Pick an account, with the account list open
Check it worked
- Send test. Microsoft has no test mode for live accounts, so Ledion’s Send test uploads nothing to Microsoft. It checks that the goal exists and is active.
- Activity shows each real send as sent, or failed with Microsoft’s reason.
- Microsoft Advertising shows the conversions in reporting within 6 hours.
Common problems
- “That didn’t connect.” The sign-in didn’t finish, for example because the access request was declined. The page says why. Close the tab and try again from Ledion in HubSpot.
- Microsoft says your organization hasn’t enabled Microsoft Advertising (error AADSTS650052). Your Microsoft Entra ID admin has to allow it first. See Admin consent.
- “Microsoft Ads connection needs reconnecting.” Microsoft stopped accepting Ledion’s sign-in. That happens after a password change, when an admin revokes access, or when someone removes Ledion’s consent. Click Reconnect on the connection, sign in again and pick the account. Then use Retry failed sends in Activity for anything that failed in the last 7 days.
- “Ledion can’t access [account] in Microsoft Ads. Check that access is still granted.” The Microsoft user you signed in with lost access to the account. Microsoft also answers this way when the account isn’t enabled for offline conversions. Give that user access again, or add Microsoft Ads again in Connections and sign in with a user who has it, then pick the same account. Then use Retry failed sends in Activity.
- “Microsoft Ads can’t find ‘[goal name]’. It may be deleted, paused or renamed in Microsoft Ads.” The goal was renamed, paused or deleted. Turn it back on, or pick it again in the conversion.
- “Microsoft Ads isn’t ready to accept this conversion yet. A new conversion action takes a few hours; an older one may need a setting changed in Microsoft Ads.” Usually the goal is less than 2 hours old. Ledion retries after 2 hours and again after 6.
- “Microsoft Ads didn’t recognize the click ID (wrong account or too old).” The click ID belongs to a different ad account, or it’s malformed.
- The send shows as Too old (“Too old for Microsoft Ads (90-day limit).”). The conversion is more than 90 days old, or later than the goal’s conversion window allows after the click. Widening the goal’s window (90 days at most) helps new conversions. It doesn’t recover sends that already expired.
- “Microsoft Ads: the conversion time is earlier than the ad click or the lead. Check what the step maps to Occurred at.” Microsoft only counts conversions after the click, so Ledion doesn’t send it: the result shows as Too old (
expired). Check which property the step maps to Occurred at, and its time zone. - “Microsoft Ads: no click ID, email or phone on the contact.” The step’s
microsoftoutput isno_match. Microsoft needs the click ID, an email or a phone. A goal with enhanced conversions off matches on the click ID only. The capture script saves the click ID through your HubSpot forms.
To disconnect, remove the connection on Ledion’s Connections page (Disconnect and uninstall).
Admin consent
When your organization’s Microsoft Entra ID tenant hasn’t enabled Microsoft Advertising, the sign-in fails with error AADSTS650052. Microsoft’s message says the app “needs access to a service” that your organization “has not subscribed to or enabled”. Your Entra ID admin fixes it with the two steps Microsoft documents.
First, add the Microsoft Advertising service principal to your tenant:
POST https://graph.microsoft.com/v1.0/servicePrincipals
{"appId": "d42ffc93-c136-491d-b4fd-6f18168c68fd"}Then grant Ledion consent, as a tenant admin, by opening this link with your tenant ID and Ledion’s client ID filled in. Email santi@ledion.io for Ledion’s client ID, or for the full link.
https://login.microsoftonline.com/<tenant ID>/v2.0/adminconsent?client_id=<Ledion's client ID>&state=12345&scope=d42ffc93-c136-491d-b4fd-6f18168c68fd/msads.manageMicrosoft also asks that at least one admin user of your tenant is added to Microsoft Advertising and enabled for work accounts there.
Something missing or wrong? Email santi@ledion.io.