← Protocols
Spindl
01Description

Web3 attribution and ad-network platform that maps off-chain marketing touchpoints (Twitter, Telegram, Lens, paid campaigns) to on-chain wallet actions inside your dApp. Lets growth teams measure CAC, ROAS, and channel ROI for crypto-native acquisition.

02Best for
  • 01marketing attribution for dapps
  • 02campaign ROAS / CAC measurement
  • 03linking off-chain ads to on-chain conversions
  • 04running incentivized acquisition (Spindl ad network)
  • 05tying a wallet back to its first-touch source
03Install
  • pnpm add @spindl-xyz/attribution
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_SPINDL_SDK_KEYClientSpindl SDK key from the Settings page in app.spindl.xyz. Client-safe (it identifies the project, not a user) but rotate if leaked.
05Prompt snippet
Install `@spindl-xyz/attribution` and configure once at app boot: `import spindl from '@spindl-xyz/attribution'; spindl.configure({ sdkKey: process.env.NEXT_PUBLIC_SPINDL_SDK_KEY!, debugMode: process.env.NODE_ENV !== 'production' })`. Call `spindl.pageView()` on every route change (in Next.js App Router wire it from a `'use client'` component listening to `usePathname`). The critical attribution call is `spindl.attribute(walletAddress)` — fire it the moment a user connects their wallet so Spindl can stitch the off-chain campaign UTM/referrer to the on-chain address. For static sites use the CDN script `<script async data-key='...' src='https://cdn.spindl.xyz/attribution-1-8-1.js'></script>` which auto-tracks page views and wallet connects.
06Gotchas
  • GDPR / cookie consent: Spindl uses fingerprint+cookie attribution — you MUST gate `configure()` and `pageView()` behind your CMP for EU/UK users or you'll be in breach. Don't load the script before consent is granted.
  • Attribution windows default to a fixed click-to-conversion window (commonly 7–30 days depending on plan) — confirm the exact window in your Spindl dashboard before reporting numbers; conversions outside the window silently drop.
  • PII handling: never pass email or user IDs as the second arg to `attribute()` — Spindl is wallet-first; mixing PII in can violate your privacy policy and risks de-anonymizing users.
  • Mobile webviews and in-app browsers (Twitter, Telegram, MetaMask Mobile) often strip referrer / UTM params — for KOL campaigns use Spindl's branded short links, don't rely on `document.referrer`.
  • Sybil filtering is on by default for ad-network payouts but NOT for analytics — if you read raw conversion counts via the API you'll see bot/sybil traffic; filter by Spindl's `is_sybil` flag where exposed.
  • `spindl.attribute(address)` is idempotent but not retroactive across sessions — if a user connected in an older session before Spindl was installed, that attribution is lost and cannot be backfilled.
07Alternatives