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:
| Source | How to get it |
|---|---|
| Reporting API | GET /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 level | the ID is shown in the ad list and in the URL of the ad you have open (selected_ad_ids=…) |
| Exported report | the 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:
| Side | Comes from | Keyed by |
|---|---|---|
| Spend | the ad platform | ad_id |
| Leads | your tracking | the 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.
Related terms
- Click ID — how a lead finds its ad
- Creative attribution — why this level exists
- CPL calculator — put a cost per lead on each ad_id
- DropCPL vs Hyros — ad_id mapping done by hand versus by the ad platform