Ads · Tracking Tags
Creates a conversion event.
POST
https://api.pozy.ai/v1/accounts/{accountId}/tracking-tags/{tagId}/eventsFacebook and Instagram, Google Workspace, TikTok, LinkedIn, X and openai and 1 morecreateTrackingTagEvent
Guides: X Ads, ChatGPT Ads, 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 |
|---|---|---|
accountIdrequired | string | |
tagIdrequired | string |
Request body
application/json, required
adAccountIdstringnamestringrequired1 to 200 characters.
typestringsiteEventstringOne of
page_view,view_content,add_to_cart,search,initiate_checkout,add_payment_info,purchase.enabledbooleandefaultValuenumberAt least 0.
currencystringclickWindowDaysinteger1 to 365.
viewWindowDaysinteger0 to 365.
urlContainsstring1 to 500 characters.
Example
curl -X POST "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/tracking-tags/697ae8efd24020381023ee99/events" \
-H "Authorization: Bearer $POZY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme"
}'const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/tracking-tags/697ae8efd24020381023ee99/events", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POZY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Acme"
}),
});
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.post(
"https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/tracking-tags/697ae8efd24020381023ee99/events",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
json={
"name": "Acme",
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
201 on success
platformstringeventobject14 child fields
idstringrequirednamestringrequiredtypestringsiteEventstringOne of
page_view,view_content,add_to_cart,search,initiate_checkout,add_payment_info,purchase.siteEventIdstringstatusstringdefaultValuenumbercurrencystringclickWindowDaysintegerviewWindowDaysintegerurlContainsstringalwaysUseDefaultValuebooleanprimarybooleancountingTypestringOne of
one,every.
201 response
{
"platform": "instagram",
"event": {
"id": "6bfebd43ddc270f6d2c56fc5",
"name": "Acme",
"type": "string",
"siteEvent": "page_view",
"siteEventId": "6a036e72b4645cc9fc4fed0b",
"status": "active",
"defaultValue": 12.5,
"currency": "USD",
"clickWindowDays": 1,
"viewWindowDays": 1,
"urlContains": "https://pozy.ai/media/example-1.jpg",
"alwaysUseDefaultValue": true,
"primary": true,
"countingType": "one"
}
}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 tagsPATCHSet 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 eventsPATCHUpdate 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