ads

POST /v1/ads/site-tags

Add a site and mint its public tag key.

All ads endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

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

NameTypeRequiredWhat it is
site_hoststringNo—
google_ads_idstringNoGoogle Ads tag id, AW- plus digits; empty for none.
ga4_idstringNoGA4 measurement id, G- plus letters/digits; empty for none.
google_labelsobjectNoGoogle Ads conversion label per outcome kind (purchase, trial, lead, signup, activation, retained7, retained30, upgrade, free_listing). An empty label removes the kind.
microsoft_uet_idstringNoMicrosoft Advertising UET tag id (digits).
meta_pixel_idstringNoMeta pixel id (digits). Loaded only once ad consent is granted.
consent_defaultstring<denied_eea, denied, granted>NoAd consent before the visitor's banner answers: denied in the EEA, UK and Switzerland (default), denied everywhere, or granted.
wait_for_update_msintegerNoHow long Google's tags wait for the banner's answer.
keep_click_idsbooleanNoKeep gclid, gbraid, wbraid, msclkid and fbclid in a first-party cookie for 90 days, only after ad consent.
enabledbooleanNo—
org_idstringNoRequired when you manage more than one organisation.

Response

NameTypeRequiredWhat it is
idstringYes—
org_idstringYes—
site_hoststringYes—
public_keystringYesPublic (it is in the page source); never an API credential.
google_ads_idstringYes—
ga4_idstringYes—
google_labelsobjectYes—
microsoft_uet_idstringYes—
meta_pixel_idstringYes—
consent_defaultstring<denied_eea, denied, granted>Yes—
wait_for_update_msintegerYes—
keep_click_idsbooleanYes—
enabledbooleanYes—
versionintegerYes—
updated_atobjectYes—
servedobjectNoza-126: the ids this site actually serves — its own, else the organisation's tracking hub's.
installAdsSiteTagInstallYes—
shieldobjectNoWhat 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