hermosodocs

send_tiktok_ads_events

Send server-side conversion events to TikTok (Events API 2.0) destructive

Area: MEASUREMENT · Ad campaign management. Generated from the running MCP server, like the rest of the tool reference.

Description

SERVER-SIDE CONVERSION TRACKING — report a purchase, signup, form submission or lead to TikTok straight from a server, so TikTok can attribute it and optimise delivery toward it. This is what makes a pixel useful: a pixel with no events is inert, and a conversion campaign optimising toward an event nobody sends has nothing to learn from. ALWAYS OFFER testEventCode FIRST: an event carrying it lands in the Test Events tab of Events Manager and is EXCLUDED from reporting, attribution and optimisation, whereas an event sent WITHOUT it is a real, permanent conversion that TikTok will optimise against and that NO endpoint deletes. The code is copied out of Events Manager in a browser (open the pixel or event set > Test Events > the code button under "Test Server Events") and no API mints one, exactly like a Spark Ads authorization code. eventTime is a Unix timestamp in SECONDS — milliseconds are refused here for free, because TikTok accepts them and reads them as a date tens of thousands of years away, so the event is silently attributed to nothing. Emails, phones and external ids are trimmed, lower-cased, E.164-normalized and SHA-256 hashed by Hermoso exactly as TikTok specifies before anything leaves the process; a value that is already a 64-character hash is passed through untouched, so nothing is ever double-hashed. A phone with no "+" country code is refused rather than guessed. Free.

Parameters

ParameterTypeDescription
advertiserIdstringTikTok ad account id from list_tiktok_ads_accounts; omit when only one account is shared with this profile
eventSourcerequired"web" | "app" | "offline" | "crm"web = a website pixel · app = a mobile app (TikTok gates this behind an allowlist) · offline = a physical store · crm = lead events from a CRM
eventSourceIdrequiredstringweb: the pixel CODE from list_tiktok_ads_pixels (NOT the pixelId) · app: the TikTok App ID · offline: the Offline Event Set ID · crm: the CRM Event Set ID
testEventCodestringfrom Events Manager > Test Events. WITH it nothing reaches reporting or optimisation; WITHOUT it these are real permanent conversions. Offer it before sending anything live.
eventsrequiredobject[]up to 1000 per request — above that TikTok rejects the WHOLE request, not the overflow
events[].eventrequiredstringa TikTok standard event (CompletePayment, Purchase, AddToCart, CompleteRegistration, SubmitForm, ViewContent …) or your own custom name
events[].eventTimerequirednumberUnix timestamp in SECONDS, UTC
events[].eventIdstringREQUIRED if the same event is also sent by the browser pixel — TikTok deduplicates on event_source_id + event_id + event
events[].userobject{ email, phone, external_id, ttclid, ttp, ip, user_agent } — email/phone/external_id are hashed for you
events[].propertiesobject{ value, currency, contents:[{content_id, content_name, price, quantity}], order_id … }
events[].pageobject{ url, referrer } — REQUIRED for web events
events[].appobjectREQUIRED for app events
events[].adobjectoptional TikTok ad-attribution object (for example a callback value), passed through as sent
events[].leadobjectREQUIRED for crm events
events[].limitedDataUsebooleantrue marks the event as limited data use, for a person who opted out of data processing

Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and POST https://app.hermoso.ai/v1/tools/send_tiktok_ads_events.

MCP (tools/call)

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"send_tiktok_ads_events","arguments":{"eventSource":"<one of the listed values>","eventSourceId":"<string>","events":"<array>"}}}

CLI

hermoso call send_tiktok_ads_events --json '{"eventSource":"<one of the listed values>","eventSourceId":"<string>","events":"<array>"}'

Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See Credits & costs.

All 759 Ad campaign management tools · tools.json