ads
POST /v1/ads/site-tags
Add a site and mint its public tag key.
Authentication
Send an API key as a bearer token. The key must carry the ads.manage permission; a key without it is refused with 403, not 404.
Where your organisation id goes
This endpoint takes org_id as a field in the JSON body.
Your organisation id is on the API keys screen in your dashboard, beside the key itself. It is the same id in every call you make.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X POST https://api.zinndigital.com/v1/ads/site-tags \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
Gated on ads.manage; audit-logged (ads.site_tag_created). site_host may be pasted as a URL (it is reduced to the host). The public_key is in the customer's page source and is NOT a secret: it only selects public tag ids. A second tag for the same host in the organisation is a 409 (refusal.adsconnect.siteTag.duplicateHost); a value in the wrong format is a 422 (refusal.adsconnect.siteTag.*).
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
site_host | string | No | — |
google_ads_id | string | No | Google Ads tag id, AW- plus digits; empty for none. |
ga4_id | string | No | GA4 measurement id, G- plus letters/digits; empty for none. |
google_labels | object | No | Google Ads conversion label per outcome kind (purchase, trial, lead, signup, activation, retained7, retained30, upgrade, free_listing). An empty label removes the kind. |
microsoft_uet_id | string | No | Microsoft Advertising UET tag id (digits). |
meta_pixel_id | string | No | Meta pixel id (digits). Loaded only once ad consent is granted. |
consent_default | string<denied_eea, denied, granted> | No | Ad consent before the visitor's banner answers: denied in the EEA, UK and Switzerland (default), denied everywhere, or granted. |
wait_for_update_ms | integer | No | How long Google's tags wait for the banner's answer. |
keep_click_ids | boolean | No | Keep gclid, gbraid, wbraid, msclkid and fbclid in a first-party cookie for 90 days, only after ad consent. |
enabled | boolean | No | — |
org_id | string | No | Required when you manage more than one organisation. |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
id | string | Yes | — |
org_id | string | Yes | — |
site_host | string | Yes | — |
public_key | string | Yes | Public (it is in the page source); never an API credential. |
google_ads_id | string | Yes | — |
ga4_id | string | Yes | — |
google_labels | object | Yes | — |
microsoft_uet_id | string | Yes | — |
meta_pixel_id | string | Yes | — |
consent_default | string<denied_eea, denied, granted> | Yes | — |
wait_for_update_ms | integer | Yes | — |
keep_click_ids | boolean | Yes | — |
enabled | boolean | Yes | — |
version | integer | Yes | — |
updated_at | object | Yes | — |
served | object | No | za-126: the ids this site actually serves — its own, else the organisation's tracking hub's. |
install | AdsSiteTagInstall | Yes | — |
shield | object | No | What the click shield has seen through this tag (SHIELDTAG, docs/1006.d/features/za-316-shieldtag.md): when the last paid-click landing beacon arrived and the clicks scored from… |
Errors this endpoint can return
401 · 403 · 404 · 409 · 422