Integration
Meta Ads integration - what AdOps reads and writes
AdOps connects to Meta Ads through the Graph API. It reads campaign and ad set entities with server-side filtering, then batches an Insights request covering only the fields a rule names. It writes campaign status, daily budget and campaign name, and can submit a deep copy of a campaign.
The Meta Graph API connection AdOps evaluates rules against: it reads campaign entities and batched Insights, and writes campaign status, budget and name.
In numbers
The figures behind this connection
- Graph API version
- Read from the FACEBOOK_VERSION setting, with v18.0 as the in-code fallback Meta's paging cursors are re-pinned to the configured version before they are re-issued.
- Entities per page
- 1,000, with automatic cursor paging until the account is exhausted
- Entity fetch retries
- 3 attempts in total, waiting 1 second then 2 seconds
- Insights cost per campaign
- 1 batched request covering every reporting period in the rule
- HTTP timeout
- 30 seconds per Graph API call
- Write level
- Conditions evaluate at campaign or ad set level; every write action is campaign-shaped
The exchange
What AdOps reads, and what it writes.
Two lists, no summary in between. Anything absent from the write column is something AdOps cannot change in this system.
AdOps reads
Every field the engine requests, and nothing else.
- Campaign or ad set entities from the ad account's edge, requesting only the name and created time fields
- Server-side filtering on campaign ID, campaign name and campaign effective status, so Meta narrows the account before it answers
- Up to 1,000 entities per page, following Meta's own paging cursor until the list is exhausted
- Insights, batched into a single Graph request carrying one relative URL per reporting period the rule uses
- Only the Insights fields a rule's conditions actually name, de-duplicated across those conditions
- Single-object reads for daily budget, name, remaining budget and lifetime budget, issued only when a rule asks for them
- The /me endpoint for token verification and /me/adaccounts for ad-account discovery
AdOps writes
Every change the engine is able to make.
- Campaign status: ACTIVE to start, PAUSED to pause, DELETED to delete
- Daily budget: increase, decrease or set, written as a whole number and clamped to the rule's maximum or minimum cap
- Campaign name: append rendered text, remove a substring, or replace one substring with another
- A deep copy of a campaign, submitted as an async batch job against the campaign's copies edge
Sample data
Sample data AdOps connects to Meta Ads through the Marketing (Graph) API using an access token created when the ad account is connected. It reads campaign entities and batched Insights to evaluate a rule’s conditions, then writes four things back: campaign status, daily budget, campaign name, and a deep copy of a campaign.
What does AdOps read from Meta Ads?
Two kinds of data. First, entities. AdOps lists the ad account’s campaigns or ad sets, asking for only the name and created time fields, and pushes the rule’s pre-filters into the request so Meta narrows the account before answering. Campaign ID, campaign name and campaign effective status are all filterable server-side. Pages come back 1,000 entities at a time and AdOps follows Meta’s own paging cursor until there are no more.
Second, Insights. Rather than one call per condition, AdOps groups every condition by its reporting period, unions and de-duplicates the fields each period needs, then sends the whole set as one Graph batch request per campaign. A rule comparing today against the last 7 days and the last 30 days costs one round trip, not three. That batched request is issued with the unified attribution setting, so the numbers a rule evaluates use the attribution window configured on the ad set.
A handful of values are not Insights fields and are fetched separately, on demand only. Daily budget, remaining budget and lifetime budget are read from the campaign object, and AdOps issues that extra call only when a rule actually references one of them.
What does AdOps write back?
Four write paths, all at campaign level. Status changes post ACTIVE, PAUSED or DELETED. Budget actions increase, decrease or set the daily budget, computed as a flat amount, a percentage of the current budget, or a custom-metric result; the projected figure is floored to a whole number and clamped, so a rule that would cross its maximum cap writes exactly the cap instead. Name actions append rendered text, strip a substring or replace one substring with another. Duplication submits an async batch job against the campaign’s copies edge with deep copy enabled.
Before a budget write, AdOps re-reads the live daily budget from Meta; before a name write, it re-reads the live name. Neither is taken from the copy carried in the job, so an edit made in Ads Manager between the fetch and the write is not silently overwritten with a stale figure. Budget and name changes record the value before and the value after on the rule result.
How does AdOps keep the API cost down?
By asking for less. The Insights field list per period is derived from the rule’s own conditions rather than requesting the full Insights surface, and metrics that are not Insights fields at all, such as time-of-day conditions and custom metrics, are filtered out of the request entirely. Entity fetches request two fields. Object reads are conditional.
What happens when the Graph API fails?
Fetching an account’s entities is retried, 3 attempts in total with 1-second then 2-second waits, and an account that still fails is skipped so the rest of the sweep continues. Parsing a batched Insights response is retried up to 3 attempts before the failure is logged with its full request context. Every write goes through one instrumented wrapper that captures the function, the message, the request body and Meta’s own error response into a deduplicated error log, so a recurring API fault appears once with a count rather than as thousands of identical lines.
AdOps is an independent product and is not affiliated with Meta Platforms. Meta, Facebook and Ads Manager are trademarks of Meta Platforms, Inc.
Questions
Asked about this connection.
Direct answers, with the numbers attached.
Does AdOps need my Facebook password?
No. AdOps stores a Meta access token created when the ad account is connected and sends it as a bearer token on every Graph API call. Disconnecting from the Integrations screen removes the token and the ad accounts AdOps discovered with it.
Which Meta Graph API version does AdOps call?
The version is a deployment setting named FACEBOOK_VERSION, with v18.0 as the fallback compiled into the code. Because Meta's paging cursors are absolute URLs carrying their own version segment, AdOps strips that prefix and re-issues page two onward against the configured version, so a multi-page account stays on one version throughout.
How many Meta API calls does one rule run cost?
One entity listing per ad account per page of 1,000 campaigns, then one batched Insights request per campaign that covers every reporting period in the rule at once. AdOps adds one object read only when a condition uses daily budget, remaining budget or lifetime budget, and one extra Insights call for each metric-versus-metric condition.
Can AdOps change an individual ad?
No. A rule can evaluate its conditions at campaign or ad set level, but every action AdOps writes is campaign-shaped: status, daily budget, name and duplication are all sent to the campaign object.
What happens if Meta returns an error part-way through a run?
Fetching an ad account's entities is retried up to 3 attempts in total, waiting 1 second and then 2 seconds, and an account that still fails is skipped without stopping the other accounts in the sweep. Each campaign is evaluated inside its own error boundary, so one broken campaign does not abort the batch.
Is AdOps affiliated with Meta?
No. AdOps is an independent product and is not affiliated with, endorsed by or sponsored by Meta Platforms. Meta, Facebook and Ads Manager are trademarks of Meta Platforms, Inc.
Try this connection on your own account.
Every integration on this page is included on every plan. Connect it, leave your first rule in draft, and read the log after the first run.