Skip links
View Categories

Connect Meta Ads, Google Ads or TikTok Ads with your own API keys (Pro)

3 min read

Smart Ads Insight shows what your ad spend brings on your site: spend per campaign next to the visits, leads and orders your own site recorded. To read the spend, Opti-Behavior Pro connects to your ad account with keys you create yourself. Open Opti-Behavior > Settings > Ads: one card per network, with a step-by-step guide under each form.

What you get once connected: the Ads Insight tab and the Ads section of the report. See Smart Ads Insight (Pro).

Meta Ads #

Meta Business Settings, Generate token dialog: select the app the system user token is generated for
Meta Business Settings: “Generate new token” starts by asking for the app.
  1. In Meta Business Settings > Users > System users, add a system user (role Employee is enough) and give it your ad account with “View performance”.
  2. Click “Generate new token”, pick an app of your business, tick ads_read, and paste the token in “System User access token”.
  3. Ad account ID: in Ads Manager, the number in the account menu at the top left (with or without act_).
  4. App ID and App secret are optional: fill them only if your Meta app requires “app secret proof”. Click Save.

Google Ads #

Google Auth Platform, Create OAuth client ID form: Web application type, client name, authorized redirect URI and Create button
Google Cloud: create a Web application OAuth client in your own project.
  1. Create an OAuth client in your own Google Cloud project and request Explorer access on the Google Ads API page (no developer token is asked).
  2. Paste the OAuth client ID, the client secret and your 10-digit customer ID.
  3. Click “Authorize Google Ads” and accept with a Google account that can see the ad account.

The access Google grants (scope “adwords”) includes read and write access to your Google Ads account; Opti-Behavior Pro uses it only to read. If your OAuth app stays in “Testing” mode, Google expires the refresh token after 7 days: publish the app.

TikTok Ads #

TikTok developer app, Authorization: Ad account management and Reporting permissions ticked
TikTok developer app: tick Ad account management and Reporting.
  1. Create a TikTok developer app with the Ad Account Management and Reporting permissions. TikTok reviews the developer account first, then the app: allow a few days.
  2. Once approved, paste the App ID and Secret, click “Authorize TikTok”, sign in with the account that manages your ads and tick your advertiser account (or paste an access token yourself).
  3. Advertiser ID: the number under the account name in TikTok Ads Manager.

Test, sync, disconnect #

“Test connection” checks the keys. The import runs daily; “Sync now” runs it at once. Figures are kept for a rolling 30 days. “Disconnect” deletes the keys from your site; the figures already imported stay and drop out as they pass 30 days. Disconnecting does not cancel the access on the network’s side: to withdraw it, revoke the token or the app in your Meta, Google or TikTok account. Uninstalling Opti-Behavior Pro deletes the keys and the imported figures.

Good to know #

Your API credentials are stored encrypted in your WordPress database and are sent only to Meta, Google or TikTok. They never pass through Opti-Behavior servers. Anyone with admin or database access to your site can use them. Opti-Behavior Pro only sends read (reporting) requests; it never creates, edits or deletes campaigns. The Google Ads and TikTok Ads connections were built against the public API documentation and checked with simulated responses; we have not yet run them on a live ad account. Details: Privacy policy, section 3.4.

Meta, Google Ads and TikTok are trademarks of their owners. Opti-Behavior is not affiliated with or endorsed by them.

Leave a comment

Explore
Drag