Automating ad reporting across platforms with APIs
Pulling Meta, Google and TikTok data into one place is easy until metrics, time zones and attribution windows disagree. A blueprint for a reporting pipeline that lasts.
AI & Automation6 min readREVANTO MANAGEMENT - FZCO

Most teams that advertise on more than one platform end up with the same weekly ritual: export from each ads manager, paste into a spreadsheet, fix the columns, then argue about why the totals do not match. It works until the account count grows, someone goes on holiday, or a client asks why last Tuesday's numbers changed.
Automating this through the platforms' APIs is within reach of a small team. The hard part is not the API calls. It is deciding what the numbers mean, keeping them consistent across platforms, and maintaining the pipeline as the APIs evolve. This piece walks through the architecture at a conceptual level.
The three APIs at a glance
- Meta Marketing API. Reporting comes from the Insights endpoints, queried at account, campaign, ad set or ad level with the fields, breakdowns and date ranges you choose. Access runs through a Meta app connected to your Business Manager. For server-to-server pipelines, the usual pattern is a system user with only the permissions it needs, rather than a personal login.
- Google Ads API. Data is queried with the Google Ads Query Language (GAQL), a SQL-like syntax over resources such as campaigns, ad groups and keywords. You need a developer token and OAuth credentials, and typically a manager account (MCC) to reach multiple client accounts through one connection. Developer token access levels affect what you can do, so check the current requirements.
- TikTok Marketing API. Accessed through TikTok's API for Business developer portal. Advertisers authorize your app, and reporting endpoints return metrics at advertiser, campaign, ad group and ad level with the dimensions you request. Business Center helps manage access across multiple advertiser accounts.
All three use token-based authorization, rate limits and versioned releases, which matters later. If you also run Microsoft Advertising, Snapchat, Pinterest or LinkedIn, the same patterns apply.
Choose the destination: sheet or warehouse
For a handful of accounts and a few dimensions, a scheduled script that writes into a spreadsheet is fine. It is cheap, visible and easy to share. It struggles with row volume, long history, joins to other data and access control.
A warehouse such as BigQuery, Snowflake or Postgres earns its place when you need ad-level history, joins with store or CRM data, or several dashboards drawing on the same numbers. A common layered structure:
- Raw: API responses stored as received, per platform, with the pull date and API version.
- Staging: cleaned and typed, one row per platform, account, entity and day.
- Reporting: unified tables with standard metric names, ready for dashboards.
Keeping the raw layer lets you reprocess history when a definition changes, without calling the APIs again.
Managed connector services can handle extraction for a fee. They reduce maintenance, but you still own the definitions, the naming taxonomy and the checks. Whichever route you take, keep the credentials, developer apps and ad accounts owned by the business, not by an individual employee or a vendor.
Normalize metrics and naming
Platforms use similar words for different things. Before building dashboards, write a data dictionary that maps each platform's fields to your standard metrics, and note where they are not equivalent:
- Clicks. Meta distinguishes link clicks from all clicks, and Google and TikTok have their own definitions. Pick the closest match to "click to the website" on each platform and label it as such.
- Conversions. Each platform counts conversions according to its own tracking setup and conversion definitions. A "purchase" on one platform and a "conversion" on another may count different events.
- Video views. What counts as a view differs by platform.
- Currency and time zone. Each ad account has its own currency and reporting time zone. Convert currency with a documented daily rate and record each account's time zone, or daily totals will never reconcile.
Naming conventions do the rest. If campaign names follow a fixed pattern, for example market, objective, funnel stage, product and launch date separated by a consistent delimiter, the pipeline can parse names into dimensions and you can report by product or market across every platform. Enforce the convention at launch, because renaming later is slow, and flag any campaign that fails to parse instead of silently dropping it.
Attribution windows will never fully match
Each platform attributes conversions using its own windows and models. Meta's default attribution setting combines click-through and view-through windows. Google Ads sets conversion windows per conversion action and applies its own attribution models. TikTok has its own settings again. Defaults change, so store the attribution settings alongside the data and record which window each figure uses.
Two practical consequences:
- Cross-platform totals overcount. If a customer saw a Meta ad and later clicked a Google ad, both platforms may claim the sale, so summed platform conversions can exceed actual orders. Present platform-reported figures as each platform's view, and use your store, CRM or billing system as the source of truth for totals.
- Recent days restate. Platforms often attribute conversions back to the date of the ad interaction, so yesterday's numbers keep changing for days. Re-pull a rolling window of recent dates on every run and overwrite those rows rather than appending.
If your report does not say which attribution window and time zone a number uses, someone will eventually compare it to a number that uses a different one.
Scheduling, reliability and alerts
Running the pipeline
- Run daily, after the reporting day has closed in each account's time zone, plus the rolling re-pull of recent dates.
- Make loads idempotent: rerunning the same date range should replace data, not duplicate it.
- Respect rate limits with batching, backoff and retries, and log failures with enough context to rerun just that slice.
- Monitor the pipeline itself: freshness (did today's load run), completeness (did every account return data) and row counts compared with recent history.
Alerting on anomalies
Once data lands automatically, use it for alerts as well as dashboards. Useful rules include:
- Spend in an account or campaign well above or below its recent daily average.
- Zero spend on a campaign that should be live.
- Conversions falling to zero while clicks hold steady, which often points to broken tracking rather than poor performance.
- CPA or ROAS outside a range you set per account.
- Pacing that will overshoot the monthly budget.
Set thresholds per account, send alerts where people already work, such as chat or email, and link each alert to the relevant view. Too many alerts get ignored, so review the rules regularly and remove any that never lead to action.
Plan for maintenance
These APIs are not static. Google releases new Google Ads API versions regularly and retires older ones on a published schedule. Meta deprecates Graph and Marketing API versions over time, and TikTok updates its API as well. Fields are renamed, metrics are retired and permission requirements change.
Budget for it:
- Subscribe to each platform's developer changelog and deprecation notices.
- Pin API versions in configuration and upgrade deliberately, testing against a known date range before switching.
- Track token and credential expiry, and keep ownership of developer apps with the business.
- Keep the data dictionary current. It is the document that explains why your numbers differ from what the ads manager shows.
How we approach this
We design reporting pipelines around a written data dictionary and naming convention first, then build extraction, normalization and alerting on infrastructure the client owns. Where a managed connector is the better fit, we say so. You can read more about our technology, AI and automation consulting or contact us to discuss your reporting setup.
This article is general information, not legal, tax or financial advice. Platform features and policies change; check the current documentation of each platform or provider. See our Disclaimer.



