Glossary

ad_id

The platform identifier for a single ad. Why it is the join key between spend and leads, and why manual mappings break.

ad_id is the ad platform’s unique identifier for a single ad object.

Format

An ad_id is a long numeric string assigned by the platform, not a name you choose. Meta IDs are typically 17–18 digits (120203456789012345), Google Ads and TikTok IDs are numeric too, and some platforms expose them as opaque strings.

Two consequences follow:

  • Store it as a string, never as a number. A 17-digit value is larger than the largest integer JavaScript can hold exactly (2^53 ≈ 9.007×10^15), so a JSON number field silently rounds the last digits and the join breaks.
  • Do not parse it. The digits carry no meaning: no campaign, no date, no creative. Every piece of context comes from the platform’s reporting API, keyed by that string.

Where to find it

Three reliable places, in order of preference:

SourceHow to get it
Reporting APIGET /act_<account_id>/ads on the Meta Marketing API returns id for every ad; the same call exists on TikTok and Google Ads
Ads manager, ad levelthe ID is shown in the ad list and in the URL of the ad you have open (selected_ad_ids=…)
Exported reportthe campaign report carries an Ad ID column next to spend and results

The value you want is the one the platform uses when it reports spend, because that is the table the ad ID has to join to. A creative filename or an ad name that looks like an ID is not one.

Why it is the join key

Attribution needs to connect two tables that come from different systems:

SideComes fromKeyed by
Spendthe ad platformad_id
Leadsyour trackingthe click ID, which resolves to an ad_id

ad_id is the only identifier both sides can agree on. Campaign names change, creative filenames are conventions, but ad_id is stable and is what the platform uses when it reports spend.

Why manual mappings break

If ads are created by hand, the link between a creative file and its ad_id lives in a spreadsheet or in a naming convention. It breaks when:

  • someone duplicates an ad and edits the copy, keeping the same name;
  • an ad is renamed in the platform after creation;
  • the same creative is used in several ads with different audiences;
  • the person who maintained the spreadsheet leaves.

When the tool that measures the ad is also the tool that creates it, the mapping is written by the system and cannot drift.

Last updated: 2026-10-26

FAQ

What is the difference between a creative and an ad?+

A creative is the asset: image, video, copy. An ad is the platform object that uses it, with a placement, an audience and an ad_id. The same creative can be several ads, which is exactly why attribution by "creative name" is unreliable.

Ready to find out what
converts, for real?

Free to start.

Start free →