Help centerAPI referenceMarketing
Marketing
Tags, cookie banner, short links, goals and server-side conversions.
Get tags, cookie banner and links
/domains/{id}/marketingdomains:readParameters
idpath · stringrequiredResource id (prj_…, dom_…)
Request
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/marketing" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 200
{
"settings": {
"consent": {
"banner": true,
"text": "Usamos cookies para medir as visitas e melhorar os anúncios.",
"policyUrl": "https://barbeariadoze.com.br/privacidade",
"position": "bottom",
"color": "#1f2937"
},
"tags": {
"ga4": "G-7KX2M9QL4P",
"gtm": null,
"googleAds": "AW-1098765432",
"metaPixel": "873214569012345",
"tiktok": null,
"linkedin": null,
"clarity": "k8m3x9q2ab",
"hotjar": null,
"pinterest": null
},
"firstParty": true
},
"links": [
{
"id": "lnk_6p2w9r",
"slug": "promo-outubro",
"url": "https://barbeariadoze.com.br/agendar?utm_source=instagram&utm_medium=bio&utm_campaign=promo-outubro",
"name": "Bio do Instagram",
"shortUrl": "https://barbeariadoze.com.br/l/promo-outubro",
"createdAt": "2026-10-14T12:30:00.000Z"
}
]
}Configure tags and cookie banner
/domains/{id}/marketingdomains:writeReplaces the whole configuration: a tag missing from the body is turned off. The edge starts injecting the tags (and the banner, if on) on every page of the domain. Short links have their own routes.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
Body
consentobjectCookie banner (GDPR/LGPD). Omitted fields go back to the default.
bannerbooleanCookie banner with accept/reject (Consent Mode v2). Without it, tags load right away.
textstring | nullBanner text (empty = default text).
policyUrlstring | nullPrivacy policy link (http/https).
position"bottom" | "bottom-left" | "bottom-right"Banner position.
colorstring | nullButton color in hex (#RRGGBB).
tagsobjectIds of the tags and pixels the edge injects. An omitted or empty tag is turned off.
ga4string | nullGoogle Analytics 4 (G-XXXXXXXX).
gtmstring | nullGoogle Tag Manager (GTM-XXXXXX).
googleAdsstring | nullGoogle Ads (AW-123456789).
metaPixelstring | nullMeta Pixel (digits only).
tiktokstring | nullTikTok Pixel.
linkedinstring | nullLinkedIn Insight Tag (partner id, digits only).
claritystring | nullMicrosoft Clarity (project id).
hotjarstring | nullHotjar (site id, digits only).
pintereststring | nullPinterest Tag (digits only).
firstPartybooleanrequiredServe the vendors' scripts from the domain itself (/__tenanci/t/…): they survive ad blockers.
Request
curl -X PUT "https://api.tenanci.com/v2/domains/dom_4h7n1q/marketing" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"consent":{"banner":true,"text":"Usamos cookies para medir as visitas e melhorar os anúncios.","policyUrl":"https://barbeariadoze.com.br/privacidade","position":"bottom","color":"#1f2937"},"tags":{"ga4":"G-7KX2M9QL4P","gtm":null,"googleAds":"AW-1098765432","metaPixel":"873214569012345","tiktok":null,"linkedin":null,"clarity":"k8m3x9q2ab","hotjar":null,"pinterest":null},"firstParty":true}'Response 200
{
"settings": {
"consent": {
"banner": true,
"text": "Usamos cookies para medir as visitas e melhorar os anúncios.",
"policyUrl": "https://barbeariadoze.com.br/privacidade",
"position": "bottom",
"color": "#1f2937"
},
"tags": {
"ga4": "G-7KX2M9QL4P",
"gtm": null,
"googleAds": "AW-1098765432",
"metaPixel": "873214569012345",
"tiktok": null,
"linkedin": null,
"clarity": "k8m3x9q2ab",
"hotjar": null,
"pinterest": null
},
"firstParty": true
}
}List campaign links
/domains/{id}/linksdomains:readClicks per link: GET /domains/:id/analytics/campaigns.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
Request
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/links" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 200
{
"items": [
{
"id": "lnk_6p2w9r",
"slug": "promo-outubro",
"url": "https://barbeariadoze.com.br/agendar?utm_source=instagram&utm_medium=bio&utm_campaign=promo-outubro",
"name": "Bio do Instagram",
"shortUrl": "https://barbeariadoze.com.br/l/promo-outubro",
"createdAt": "2026-10-14T12:30:00.000Z"
}
]
}Create a campaign link
/domains/{id}/linksdomains:writeShort link on the customer's domain (https://<domain>/l/<slug>) that redirects to url and counts the click. Up to 500 per domain; a repeated slug returns 409 slug_taken.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
Body
slugstringrequiredmax 60Short link path: https://<domain>/l/<slug>. Lowercase letters, digits and hyphens.
urlstringrequiredmax 2048Target (http/https), with the UTMs already in it.
namestring | nullA name you'll recognize.
Request
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/links" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"slug":"promo-outubro","url":"https://barbeariadoze.com.br/agendar?utm_source=instagram&utm_medium=bio&utm_campaign=promo-outubro","name":"Bio do Instagram"}'Response 201
{
"id": "lnk_6p2w9r",
"slug": "promo-outubro",
"url": "https://barbeariadoze.com.br/agendar?utm_source=instagram&utm_medium=bio&utm_campaign=promo-outubro",
"name": "Bio do Instagram",
"shortUrl": "https://barbeariadoze.com.br/l/promo-outubro",
"createdAt": "2026-10-14T12:30:00.000Z"
}Update a campaign link
/domains/{id}/links/{linkId}domains:writeParameters
idpath · stringrequiredResource id (prj_…, dom_…)
linkIdpath · stringrequiredLink id (lnk_…)
Body
slugstringmax 60Short link path: https://<domain>/l/<slug>. Lowercase letters, digits and hyphens.
urlstringmax 2048Target (http/https), with the UTMs already in it.
namestring | nullA name you'll recognize.
Request
curl -X PATCH "https://api.tenanci.com/v2/domains/dom_4h7n1q/links/<linkId>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"url":"https://barbeariadoze.com.br/agendar?utm_source=instagram&utm_medium=bio&utm_campaign=promo-novembro"}'Response 200
{
"id": "lnk_6p2w9r",
"slug": "promo-outubro",
"url": "https://barbeariadoze.com.br/agendar?utm_source=instagram&utm_medium=bio&utm_campaign=promo-novembro",
"name": "Bio do Instagram",
"shortUrl": "https://barbeariadoze.com.br/l/promo-outubro",
"createdAt": "2026-10-14T12:30:00.000Z"
}Delete a campaign link
/domains/{id}/links/{linkId}domains:writeParameters
idpath · stringrequiredResource id (prj_…, dom_…)
linkIdpath · stringrequiredLink id (lnk_…)
Request
curl -X DELETE "https://api.tenanci.com/v2/domains/dom_4h7n1q/links/<linkId>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 204
Success
List page goals
/domains/{id}/goalsdomains:readParameters
idpath · stringrequiredResource id (prj_…, dom_…)
Request
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/goals" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 200
{
"items": [
{
"id": "gol_3t8k1v",
"name": "Lead",
"pathPattern": "/obrigado",
"value": 50,
"currency": "BRL",
"createdAt": "2026-10-14T12:40:00.000Z"
}
]
}Create a page goal
/domains/{id}/goalsdomains:writeCounts a conversion when the visitor opens the page (e.g. /thank-you), without touching the app's code. Up to 50 per domain. With server-side conversions on, the goal also goes to Meta, TikTok and GA4.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
Body
namestringrequiredmax 60Goal name: letters, digits, spaces and _ (e.g. Lead, Purchase).
pathPatternstringrequiredmax 300Page: /thank-you (exact), /order/* (it and below) or /order* (starts with). A full URL is accepted.
valuenumber | nullConversion value (>= 0).
currencystring | nullCurrency (3 letters; BRL by default when there's a value).
Request
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/goals" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"name":"Lead","pathPattern":"/obrigado","value":50,"currency":"BRL"}'Response 201
{
"id": "gol_3t8k1v",
"name": "Lead",
"pathPattern": "/obrigado",
"value": 50,
"currency": "BRL",
"createdAt": "2026-10-14T12:40:00.000Z"
}Delete a page goal
/domains/{id}/goals/{goalId}domains:writeParameters
idpath · stringrequiredResource id (prj_…, dom_…)
goalIdpath · stringrequiredGoal id (gol_…)
Request
curl -X DELETE "https://api.tenanci.com/v2/domains/dom_4h7n1q/goals/<goalId>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 204
Success
Get server-side conversions
/domains/{id}/conversionsdomains:readLanding+One row per provider (meta, ga4, tiktok). hasPixel tells whether the matching tag id is set in PUT /domains/:id/marketing; without it nothing is sent.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
Request
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/conversions" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 200
{
"items": [
{
"provider": "meta",
"configured": true,
"enabled": true,
"hasPixel": true,
"testCode": "TEST48213",
"lastSentAt": "2026-10-21T18:22:05.000Z",
"lastError": null,
"lastErrorAt": null
},
{
"provider": "ga4",
"configured": false,
"enabled": false,
"hasPixel": true,
"testCode": null,
"lastSentAt": null,
"lastError": null,
"lastErrorAt": null
},
{
"provider": "tiktok",
"configured": false,
"enabled": false,
"hasPixel": false,
"testCode": null,
"lastSentAt": null,
"lastError": null,
"lastErrorAt": null
}
]
}Configure server-side conversions
/domains/{id}/conversions/{provider}domains:writeLanding+Goals also go from the server to the provider (they survive ad blockers), only with the visitor's consent when the banner is on. Meta and TikTok deduplicate against the browser pixel; GA4 only receives page goals. The token is stored encrypted and never returned. With a dashboard session, owner/admin only.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
providerpath · stringrequiredProvider: meta (Conversions API), ga4 (Measurement Protocol) or tiktok (Events API)
Body
secretstringmax 1000Provider token (Meta: Conversions API access token; GA4: Measurement Protocol API secret; TikTok: Events API access token). Required the first time.
testCodestring | nullMeta/TikTok test code (events show up in "Test events"). null removes it.
enabledbooleanTurns sending on/off without deleting the token.
Request
curl -X PUT "https://api.tenanci.com/v2/domains/dom_4h7n1q/conversions/<provider>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"secret":"TOKEN_DE_ACESSO_DA_META","testCode":"TEST48213"}'Response 200
{
"provider": "meta",
"configured": true,
"enabled": true,
"hasPixel": true,
"testCode": "TEST48213",
"lastSentAt": null,
"lastError": null,
"lastErrorAt": null
}Remove server-side conversions
/domains/{id}/conversions/{provider}domains:writeLanding+Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
providerpath · stringrequiredProvider: meta (Conversions API), ga4 (Measurement Protocol) or tiktok (Events API)
Request
curl -X DELETE "https://api.tenanci.com/v2/domains/dom_4h7n1q/conversions/<provider>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 204
Success
Send a test event
/domains/{id}/conversions/{provider}/testdomains:writeLanding+Sends a TenanciTest event to the provider right now and returns the result (detail carries the provider's response on failure). For GA4 it uses the validation endpoint.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
providerpath · stringrequiredProvider: meta (Conversions API), ga4 (Measurement Protocol) or tiktok (Events API)
Request
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/conversions/<provider>/test" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 200
{
"ok": true,
"detail": ""
}List campaign costs
/domains/{id}/costsdomains:readLanding+Spend per campaign (utm_campaign) shows up in GET /domains/:id/analytics/campaigns as cost, cost per conversion and return.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
Request
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/costs" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 200
{
"items": [
{
"id": "cst_9d4m2x",
"campaign": "promo-outubro",
"source": "instagram",
"startsOn": "2026-10-01",
"endsOn": "2026-10-31",
"amount": 1200,
"currency": "BRL"
}
]
}Add campaign costs
/domains/{id}/costsdomains:writeLanding+1 to 500 rows per call. Each entry is spread over the days of its period when computing the cost for a range. Different currencies are not converted.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
Body
itemsobject[]required≤ 500 itenscampaignstringrequiredmax 200Campaign: the same value as utm_campaign.
sourcestring | nullSource (utm_source), optional.
startsOnstringrequiredmax 10First day (YYYY-MM-DD).
endsOnstringrequiredmax 10Last day, inclusive (YYYY-MM-DD).
amountnumberrequiredAmount spent in the period (e.g. 1200.50).
currencystringmax 3Currency (default BRL).
Request
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/costs" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"items":[{"campaign":"promo-outubro","source":"instagram","startsOn":"2026-10-01","endsOn":"2026-10-31","amount":1200,"currency":"BRL"}]}'Response 201
{
"created": 1
}Delete a cost entry
/domains/{id}/costs/{costId}domains:writeLanding+Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
costIdpath · stringrequiredCost entry id (cst_…)
Request
curl -X DELETE "https://api.tenanci.com/v2/domains/dom_4h7n1q/costs/<costId>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 204
Success

