Meta Ads uses a manual token-paste flow — not OAuth. You generate a long-lived system user access token in Meta’s Business Manager, then paste it into Hiveku along with your ad account ID.
Before You Start
- A Facebook Business account at business.facebook.com
- Access to the Ad Account you want to connect (with
ads_readorads_managementpermissions) - A Meta Developer account at developers.facebook.com
Create the Meta App
Create a Business-type app
Go to developers.facebook.com > My Apps > Create App. Choose Business as the type. Name it something recognizable like
Acme Hiveku.Add the Marketing API product
In your new app, go to Add Product and find Marketing API. Click Set Up.
Generate a System User Access Token
System user tokens are long-lived (don’t expire as long as the system user exists), which makes them the right choice for server-to-server integrations like Hiveku.Open Business Settings
Go to business.facebook.com > Business Settings (gear icon).
Create a system user
Users > System Users > Add. Give it a name like
Hiveku Integration and set the role to Admin or Employee depending on how you want to scope it.Assign ad account access
Click Add Assets > Ad Accounts, pick your ad account, and assign Manage ad account permissions to the system user.
Generate the token
On the system user’s row, click Generate New Token. Select:
- App: your Business app from the previous section
- Token expiration: Never (system user tokens don’t expire)
- Scopes: at minimum
ads_read; addads_managementif you want Hiveku to also write (pause/resume, update budgets)
Find Your Ad Account ID
In Meta Ads Manager, the ad account picker in the top-left shows the ID. It’s a numeric ID with anact_ prefix:
act_ prefix when pasting into Hiveku — it’s part of the ID.
Connect in Hiveku
Paste the token and ad account ID
- Access token: the system user token from Business Manager
- Ad account ID:
act_123456789format (include theact_prefix)
What You Get
- Campaign, ad set, and ad metrics — spend, impressions, clicks, CPC, CPM, conversions
- Creative performance
- Audience insights (where enabled)
- Attribution windows configurable via the Hiveku dashboard
Rotating the Token
System user tokens don’t expire, but you should rotate periodically (e.g., every 12 months) for hygiene.Generate a new token in Business Manager
Same flow as above — pick the same system user, generate a new token.
Connect Multiple Ad Accounts
Repeat the flow for each ad account. You can reuse the same system user token if it has access to all the accounts — just paste different ad account IDs.Verify the Connection
- Connection status shows Active
- Campaigns list populates within a few minutes
- Spend and performance match what’s in Meta Ads Manager (small delays are normal)
Troubleshooting
'Invalid access token' or 'Session has expired'
'Invalid access token' or 'Session has expired'
The token is expired, revoked, or malformed. Generate a fresh system user token in Business Manager and update the connection. Make sure you copied the full token string.
'Unsupported get request' or 'Cannot find ad account'
'Unsupported get request' or 'Cannot find ad account'
Usually means the ad account ID is missing the
act_ prefix. The correct format is act_123456789, not 123456789.'Permission denied' on the ad account
'Permission denied' on the ad account
The system user token doesn’t have
ads_read (or ads_management if writing) on that specific ad account. In Business Manager, open the system user, confirm the ad account is assigned, and regenerate the token with the right scopes.Rate limit errors
Rate limit errors
Meta’s Marketing API has per-app, per-user, and per-ad-account rate limits. If you’re hitting them, consider batching requests or applying for a higher tier in Meta’s App Review. Shared apps in development mode hit limits fast — promote your app to Live status.
No data for recent campaigns
No data for recent campaigns
Meta’s insights API has inherent delays (typically up to an hour for recent metrics, longer for attribution-based conversions). Cross-check in Ads Manager — if data’s missing there too, it’s a Meta-side delay.
What’s Next?
Connect Google Ads
Add PPC from Google alongside Meta
Connect TikTok Ads
Add TikTok paid media