← Platforms
Real Conversions API
Pinterest setup
Set Pinterest’s tokens once. Then every
ads.conversions.track() call fans the event out to Pinterest server-side — no per-platform code.1. Install adscapi
shell
npm install adscapi # or run without installing: npx adscapi platforms
2. Get Pinterest's tokens
Pinterest activates once all of these are set. Run npx adscapi platforms to see them, then get each value from Pinterest’s ads or events dashboard.
PINTEREST_AD_ACCOUNT_IDPINTEREST_CAPI_TOKEN3. Set them for adscapi
Export the tokens in the environment that runs your server or the adscapi CLI.
shell
export PINTEREST_AD_ACCOUNT_ID="…" export PINTEREST_CAPI_TOKEN="…"
4. Verify
check confirms the secrets are present; verify calls Pinterest’s API to confirm they are valid.
shell
npx adscapi check npx adscapi verify --platform pinterest
5. Track a conversion
One call, sent to Pinterest and every other configured platform. Pass raw email — adscapi hashes per platform. Consent is required.
ts
import { createAdscapi } from 'adscapi';
const ads = createAdscapi();
const results = await ads.conversions.track({
name: 'purchase',
value: 49,
currency: 'USD',
user: { email: 'buyer@example.com' },
consent: { adUserData: true, adPersonalization: true },
});See the exact request on the Pinterest payload preview.