test-event
Fire one canonical conversion to every configured platform from the shell. Consent is set to granted. Use --dry-run first to confirm the fan-out, then drop it to send for real.
Usage
shell
adscapi test-event [--event <name>] [--value <n>] [--currency <code>] [--email <addr>] [--dry-run]
Flags
| Flag | Default | Effect |
|---|---|---|
--event <name> | purchase | Canonical event name (or any custom string) |
--value <n> | 1 | Conversion value (number) |
--currency <code> | USD | ISO 4217 currency code |
--email <addr> | (none) | Raw email on user — adscapi hashes per platform |
--dry-run | false | Log the fan-out without sending. Rows tag as [DRY] |
What it sends
ts
// Equivalent SDK call
await createAdscapi().conversions.track(
{
name: flags.event || 'purchase',
value: flags.value ? Number(flags.value) : 1,
currency: flags.currency || 'USD',
user: flags.email ? { email: flags.email } : undefined,
consent: { adUserData: true, adPersonalization: true },
},
{ dryRun: Boolean(flags['dry-run']) },
);For richer identity, click ids, or per-platform test event codes, use the SDK or MCP.
Examples
shell
$ npx adscapi test-event --event purchase --email you@example.com --value 49 --dry-run [DRY] meta [DRY] ga4 [DRY] tiktok $ npx adscapi test-event --event lead --email you@example.com [OK ] meta [OK ] ga4 [ERR] tiktok — invalid access token $ npx adscapi test-event No platforms configured — set platform secrets in the environment.
Tags: DRY (dry-run), OK (sent), ERR (platform failed — never blocks the rest).
Related
- conversions.track()
- Canonical events
- verify — confirm tokens before a live test-event