Skip to content
adscapi

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

FlagDefaultEffect
--event <name>purchaseCanonical event name (or any custom string)
--value <n>1Conversion value (number)
--currency <code>USDISO 4217 currency code
--email <addr>(none)Raw email on user — adscapi hashes per platform
--dry-runfalseLog 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