Microsoft Ads (formerly Bing Ads)

Configuring Microsoft Ads with Polytomic On Premises

In order to enable the Microsoft Ads integration on your Polytomic on-prem instance, you'll need to do the following:

  1. Obtain an OAuth Client ID and Client Secret pair by following Microsoft's instructions here. When prompted for the redirect URL, you should enter <YOUR_POLYTOMIC_URL>/connect/msads. For example, if you access Polytomic at https://polytomic.internal.acmecorp.com, the redirect URL will be https://polytomic.internal.acmecorp.com/connect/msads.

    When registering the application, note the Supported account types you select; this determines whether you need to configure a tenant ID in step 3.

    • Accounts in any organizational directory and personal Microsoft accounts (multitenant): no tenant ID is needed. Choose this if the Microsoft Ads account you'll connect is owned by a personal Microsoft account rather than a work account.
    • Accounts in this organizational directory only (single tenant): you must set MSADS_TENANT_ID in step 3. Without it, signing in will fail.

    You'll also need the Directory (tenant) ID for a single-tenant application. You can find it on the application's Overview page in the Azure portal, next to the Application (client) ID, or under Microsoft Entra ID > Overview. Your tenant's verified domain name (for example acmecorp.onmicrosoft.com) works anywhere the tenant ID is accepted.

  2. Obtain a Microsoft Ads Developer Token by following Microsoft's instructions here.

  3. Ask the engineer on your team that deployed Polytomic to carry out this step. Set the following environment variables in the Polytomic deployment:

  • MSADS_CLIENT_ID: set this to the Client ID value from step 1.
  • MSADS_CLIENT_SECRET: set this to the Client Secret value from step 1.
  • MSADS_DEVELOPER_TOKEN: set this to the developer token from step 2.
  • MSADS_TENANT_ID: set this to the Directory (tenant) ID from step 1 if you registered a single-tenant application. Leave it unset for a multitenant application.

Restart your Polytomic environment so that it picks up these environment variables.

  1. You'll now see the Microsoft Ads integration as a connection option in Polytomic. Follow the steps here to connect to your Microsoft Ads instance.

Troubleshooting

  • Error: -AADSTS50194: Application ... is not configured as a multi-tenant application

Your application registration is single tenant, but Polytomic is signing in against the shared /common endpoint. Set MSADS_TENANT_ID to your Directory (tenant) ID as described above and restart Polytomic, or change the registration's Supported account types to multitenant.