Ads · Tracking Tags
Sets ad tracking tags. Works with Meta Ads, Google Ads and LinkedIn Ads.
PATCH
https://api.pozy.ai/v1/ads/{adId}/tracking-tagsFacebook and Instagram, Google Workspace and LinkedInupdateAdTrackingTags
Guide: Pixels and tracking tags
Request
Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the ads resource group disabled get 403 resource_group_disabled. Authentication
Path parameters
| Name | Type | Notes |
|---|---|---|
adIdrequired | string |
Request body
application/json, required
urlTagsarray of objectkeystringrequiredvaluestringrequired
creativeobjectheadlinestringrequiredbodystringrequiredcallToActionstringrequiredlinkUrlstring (URL)requiredimageUrlstring (URL)requiredvideoUrlstring (URL)
trackingUrlTemplatestringfinalUrlSuffixstringdynamicValueParametersmap of stringcustomValueParametersmap of string
Example
curl -X PATCH "https://api.pozy.ai/v1/ads/6f40fa2fb0a7e728dd1a73b7/tracking-tags" \
-H "Authorization: Bearer $POZY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urlTags": [
{
"key": "string",
"value": "string"
}
],
"creative": {
"headline": "Launch day",
"body": "string",
"callToAction": "string",
"linkUrl": "https://pozy.ai/media/example-1.jpg",
"imageUrl": "https://pozy.ai/media/example-1.jpg"
},
"trackingUrlTemplate": "https://pozy.ai/media/example-1.jpg",
"finalUrlSuffix": "https://pozy.ai/media/example-1.jpg"
}'const res = await fetch("https://api.pozy.ai/v1/ads/6f40fa2fb0a7e728dd1a73b7/tracking-tags", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.POZY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
urlTags: [
{
key: "string",
value: "string"
}
],
creative: {
headline: "Launch day",
body: "string",
callToAction: "string",
linkUrl: "https://pozy.ai/media/example-1.jpg",
imageUrl: "https://pozy.ai/media/example-1.jpg"
},
trackingUrlTemplate: "https://pozy.ai/media/example-1.jpg",
finalUrlSuffix: "https://pozy.ai/media/example-1.jpg"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);import os
import requests
resp = requests.patch(
"https://api.pozy.ai/v1/ads/6f40fa2fb0a7e728dd1a73b7/tracking-tags",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
json={
"urlTags": [
{
"key": "string",
"value": "string",
},
],
"creative": {
"headline": "Launch day",
"body": "string",
"callToAction": "string",
"linkUrl": "https://pozy.ai/media/example-1.jpg",
"imageUrl": "https://pozy.ai/media/example-1.jpg",
},
"trackingUrlTemplate": "https://pozy.ai/media/example-1.jpg",
"finalUrlSuffix": "https://pozy.ai/media/example-1.jpg",
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
200 on success
platformstring
200 response
{
"platform": "instagram"
}Errors
Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:
| 400 | invalid_request_error | A parameter or body field is missing or invalid. param names it. |
| 401 | authentication_error | The API key is missing, revoked or expired. |
| 403 | permission_error | The key is read-only, scoped to other profiles, or has this resource group disabled. |
| 404 | not_found | Nothing with that id exists in your workspace. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.
More in Tracking Tags
GETGet ad tracking tagsGETList tracking tagsPOSTCreate a tracking tagGETGet a tracking tagPATCHUpdate a tracking tagGETList accounts it is shared withPOSTShare with an ad accountDELStop sharing with an accountGETGet store install statusPOSTInstall on a Shopify, WordPress, Wix or Webflow siteDELRemove from a Shopify, WordPress, Wix or Webflow siteGETList conversion eventsPOSTCreate a conversion eventPATCHUpdate a conversion eventDELDelete a conversion eventGETList tag usersPOSTAssign a user to a tagDELRemove a user from a tagGETList partner businesses of a tagGETGet tag diagnosticsGETGet aggregated event stats