TikTok Ad Attribution with RevenueCat (Dual-Channel)
Full-depth TikTok attribution for RevenueCat apps — client SDK reports the purchase moment, your backend forwards renewals/refunds from RC webhooks to TikTok Events API. Ships the complete Workers forwarder, device-identifier relay chain (ATT → RC → webhook → Events API), ASN wiring, and a battle-tested verification SOP (iOS + Cloudflare Workers)
Copies a short instruction with your private download link. Paste it into your agent: it downloads the whole skill (the source code, the setup steps and the mistakes we already made for you) and builds the screen.
Works with
What it does
Companion to TikTok Ad Attribution & Tracking — read that skill first for the client-SDK fundamentals (ATT flow, SKAdNetwork, App Store compliance). This skill covers what changes when your IAP stack is RevenueCat, and adds the piece StoreKit-only apps don't get: server-side renewal & refund forwarding.
Pick your skill:
| Your IAP stack | Skill | What TikTok sees |
|---|---|---|
| Native StoreKit 2 | tiktok-tracking | Purchase moments only (client-side) |
| RevenueCat | this skill | Purchase moments + renewals + refunds (true LTV) |
Why this matters: client-side tracking only fires when the user actively purchases in the foreground. Renewals happen in the background — no client code will ever see them. TikTok's value-based optimization (VBO) feeds on total revenue; without renewals you're optimizing on first payments only.
RevenueCat has no native TikTok integration (open feature request, not on their roadmap as of 2026-08). The official workaround — consume RC webhooks on your backend and forward to TikTok Events API — is exactly what this skill ships.
What you get
- ✓142 lines of source code, ready to paste
- ✓Architecture
- ✓Client Implementation (deltas vs the base skill)
- ✓Server Implementation (Cloudflare Workers / Hono)
- ✓The ASN Wiring (do not skip)
- ✓Known Pitfalls
- ✓Verification SOP (battle-tested 2026-08 on Trovy)
More in Backend
- AWS Infrastructure with CDKFreeProduction-ready AWS infrastructure using CDK — App Runner for HTTP services, Aurora Serverless for database, Cognito for auth, Lambda for serverless functions, and S3 for storage
- Supabase Row Level Security (RLS) Data IsolationFreeProduction-ready Row Level Security patterns for a Supabase + Cloudflare Workers stack — the database-layer isolation primitive that makes cross-user data leaks impossible even when a route is buggy or someone talks to PostgREST directly. Covers the owner-isolation table skeleton (1:1 profile + one-to-many children), the five load-bearing RLS rules ((select auth.uid()) wrapping, TO authenticated, forward-set child subqueries, indexing policy columns, trusting only auth.uid()/app_metadata), the service_role (bypass RLS) vs user-JWT (RLS enforced) client split, server-side owner_id injection, public read-only tables whose writes funnel through service_role, and a two-token cross-access isolation test that must return 403/empty.
- Supabase Storage Private Buckets + Signed URLsFreeProduction-ready private file storage for a Supabase + Cloudflare Workers stack — a private bucket created as an idempotent SQL migration, server-side service_role uploads (the client never talks to Storage and never holds the service key), and on-demand signed URLs with short TTLs. IDOR-proof by construction — the object path is derived from the verified JWT ({userId}/{itemId}.jpg, never client-supplied) and ownership is checked through RLS before any URL is signed — with defense-in-depth RLS policies on storage.objects, orphan-object cleanup (Postgres ON DELETE CASCADE never touches Storage), and the pitfalls of public buckets and leaked signed URLs.
- Supabase + Cloudflare Workers InfrastructureFreeProduction-ready serverless infrastructure using Supabase (managed Postgres + Auth + Storage) and Cloudflare Workers (Hono backend) — the zero-VPC, zero-server counterpart to the AWS CDK stack. Covers Supabase CLI migrations, the immutable-region rule, secret management (.dev.vars / Cloudflare Secret, never git), Workers deployment via wrangler, and dual-mode JWT verification (JWKS ES256 preferred, HS256 fallback).
- TikTok Ad Attribution & TrackingProTikTok ad attribution module with ATT permission flow, standard/custom event tracking, and debug logging — bridges to TikTok Business SDK via closure injection. Includes complete integration guide with credentials setup, App Store compliance, and campaign launch workflow (iOS only)