🆒 Your use case
When using useScriptTikTokPixel with both browser Pixel events and server-side Events API, TikTok recommends sending the same event_id on both sides so events can be deduplicated.
The current runtime implementation appears to support this at runtime because proxy.ttq forwards arbitrary calls to TikTok native queue, but the TypeScript overload for track only accepts three arguments:
proxy.ttq("track", "Purchase", properties)
For deduplication we need the fourth argument:
proxy.ttq("track", "Purchase", properties, { event_id: eventId })
This currently requires casting around the ttq type in app code. I may be missing a preferred Nuxt Scripts pattern here, but I could not find a typed helper or overload for this in the TikTok Pixel registry.
There is a related smaller typing gap: the StandardEvents union seems to include some older TikTok standard events, but not some current event names used in TikTok current event taxonomy, for example Purchase and StartTrial.
🅕 The solution you would like
Would it make sense to extend the TikTok Pixel registry types to support the native ttq("track", ..., options) form?
Something along these lines:
interface TrackOptions {
event_id?: string
}
type TtqFns =
& ((cmd: "track", event: StandardEvents | (string & {}), properties?: EventProperties, options?: TrackOptions) => void)
& ((cmd: "page") => void)
& ((cmd: "identify", properties: IdentifyProperties) => void)
& ((cmd: (string & {}), ...args: any[]) => void)
It may also be worth refreshing StandardEvents to include TikTok current standard event names. I would expect at least Purchase and StartTrial to type cleanly, while still preserving the existing escape hatch for custom strings.
🔍 Alternatives you have considered
The current workaround is to cast the proxy call locally:
const ttqTrack = proxy.ttq as (
command: "track",
eventName: string,
properties: Record<string, unknown>,
options: { event_id: string },
) => void
ttqTrack("track", "Purchase", properties, { event_id: eventId })
That works, but it loses the benefit of the registry types exactly where a common Pixel + Events API setup needs them.
ℹ️ Additional info
Relevant current source:
TikTok references I was looking at:
The existing consent API in Nuxt Scripts looks good to me (defaultConsent, consent.grant(), consent.revoke(), consent.hold()). This issue is only about the typed tracking call shape and event-name coverage.
🆒 Your use case
When using
useScriptTikTokPixelwith both browser Pixel events and server-side Events API, TikTok recommends sending the sameevent_idon both sides so events can be deduplicated.The current runtime implementation appears to support this at runtime because
proxy.ttqforwards arbitrary calls to TikTok native queue, but the TypeScript overload fortrackonly accepts three arguments:For deduplication we need the fourth argument:
This currently requires casting around the
ttqtype in app code. I may be missing a preferred Nuxt Scripts pattern here, but I could not find a typed helper or overload for this in the TikTok Pixel registry.There is a related smaller typing gap: the
StandardEventsunion seems to include some older TikTok standard events, but not some current event names used in TikTok current event taxonomy, for examplePurchaseandStartTrial.🅕 The solution you would like
Would it make sense to extend the TikTok Pixel registry types to support the native
ttq("track", ..., options)form?Something along these lines:
It may also be worth refreshing
StandardEventsto include TikTok current standard event names. I would expect at leastPurchaseandStartTrialto type cleanly, while still preserving the existing escape hatch for custom strings.🔍 Alternatives you have considered
The current workaround is to cast the proxy call locally:
That works, but it loses the benefit of the registry types exactly where a common Pixel + Events API setup needs them.
ℹ️ Additional info
Relevant current source:
TikTok references I was looking at:
event_idargument: https://ads.us.tiktok.com/help/article/tiktok-adobe-eapi-implementation-guide?lang=enThe existing consent API in Nuxt Scripts looks good to me (
defaultConsent,consent.grant(),consent.revoke(),consent.hold()). This issue is only about the typed tracking call shape and event-name coverage.