with one click
tiktok-ads-integration
// Launch TikTok ad campaigns for ecommerce with Events API server-side tracking, Spark Ads, catalog sync, and shopping ads for product discovery
// Launch TikTok ad campaigns for ecommerce with Events API server-side tracking, Spark Ads, catalog sync, and shopping ads for product discovery
Manage supplier invoices and vendor payments with automated receipt matching, payment scheduling, early discount optimization, and reconciliation workflows
Enable wholesale and B2B sales with company accounts, custom catalogs, quote workflows, purchase orders, and net payment terms
Predict future inventory needs using historical sales data, seasonal trends, and reorder points to prevent stockouts and overstock
Launch a multi-vendor marketplace with seller onboarding, commission rules, automated payouts via Stripe Connect, and vendor dashboards
Control which products appear first in collections using automated ranking rules, manual overrides, and performance-based sorting algorithms
Sync your catalog and inventory across your own site, Amazon, eBay, and wholesale channels to sell everywhere from one system
| name | tiktok-ads-integration |
| description | Launch TikTok ad campaigns for ecommerce with Events API server-side tracking, Spark Ads, catalog sync, and shopping ads for product discovery |
| category | marketing-growth |
| risk | safe |
| source | curated |
| date_added | 2026-03-12 |
| tags | ["tiktok","tiktok-ads","spark-ads","social-advertising"] |
| triggers | ["set up TikTok ads","implement TikTok pixel","create TikTok shopping ads"] |
| tools | ["claude-code","cursor","gemini-cli","copilot","codex-cli"] |
| platforms | ["shopify","woocommerce","bigcommerce","custom"] |
| difficulty | advanced |
TikTok is a primary discovery channel for ecommerce, particularly for fashion, beauty, home, and consumer goods. Reliable attribution requires pairing the browser-based TikTok Pixel with the server-side Events API (EAPI) — similar to Meta's CAPI approach. For Shopify, WooCommerce, and BigCommerce, the official TikTok integrations install both Pixel and EAPI automatically. Custom implementation only belongs in the Custom/Headless section.
| Platform | Integration Method | Pixel + EAPI | Catalog Sync |
|---|---|---|---|
| Shopify | TikTok for Shopify (official app) | Yes (built-in) | Yes (automatic) |
| WooCommerce | TikTok for WooCommerce plugin | Yes (built-in) | Yes (automatic) |
| BigCommerce | TikTok channel in Channel Manager | Yes (built-in) | Yes (automatic) |
| Custom / Headless | TikTok Pixel JS + Events API REST | Manual implementation | Manual feed generation |
For headless stores, install both the browser Pixel and server-side Events API:
Browser Pixel (add to <head> on every page):
ttq.load('YOUR_PIXEL_ID');
ttq.page();
// Product page
ttq.track('ViewContent', {
content_id: product.sku,
content_type: 'product',
content_name: product.name,
value: product.price,
currency: 'USD',
});
// Purchase — pass event_id for deduplication with Events API
const purchaseEventId = `purchase-${order.id}`;
ttq.track('CompletePayment', {
content_id: order.lineItems.map(i => i.sku).join(','),
value: order.subtotal,
currency: order.currencyCode,
order_id: order.id,
}, { event_id: purchaseEventId });
Server-side Events API (send from your order webhook):
async function trackTikTokPurchase(order: Order, req: Request) {
const eventId = `purchase-${order.id}`; // MUST match Pixel event_id for deduplication
const { createHash } = await import('crypto');
const sha256 = (val: string) => createHash('sha256').update(val.toLowerCase().trim()).digest('hex');
await fetch(
`https://business-api.tiktok.com/open_api/v1.3/pixel/track/?business_id=${process.env.TIKTOK_BUSINESS_ID}`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Access-Token': process.env.TIKTOK_ACCESS_TOKEN!,
},
body: JSON.stringify({
data: [{
pixel_code: process.env.TIKTOK_PIXEL_ID,
event: 'CompletePayment',
event_id: eventId,
event_time: Math.floor(Date.now() / 1000),
user: {
email: sha256(order.customerEmail),
phone_number: sha256(order.customerPhone?.replace(/\D/g, '') ?? ''),
ip: req.ip,
user_agent: req.headers['user-agent'],
ttclid: req.cookies['ttclid'], // TikTok click ID — strongest attribution signal
},
properties: {
value: order.subtotal,
currency: order.currencyCode,
contents: order.lineItems.map(i => ({ content_id: i.sku, content_type: 'product' })),
order_id: order.id,
},
page: { url: `${process.env.STORE_URL}/checkout/thank-you` },
}],
}),
}
);
}
In TikTok Ads Manager, build a three-tier campaign structure:
Campaign 1: Prospecting — Video Shopping Ads
Campaign 2: Retargeting — Engaged Users
Campaign 3: Spark Ads — Boost Organic Content
| Metric | Target | Where to Find |
|---|---|---|
| Pixel Event Quality Score | 7+/10 | TikTok Events Manager → Pixel |
| Video play rate (2s) | > 25% | Ads Manager → Campaign Analytics |
| Click-through rate | > 1% | Ads Manager |
| Cost per Purchase | Your target CPA | Ads Manager → Conversions |
| ROAS | > 2× for broad / > 4× for retargeting | Ads Manager → Revenue |
ttclid in all EAPI events — capture the TikTok click ID from landing page URLs (?ttclid=xxx) and store in a cookie; it is the strongest attribution signal after iOS 14| Problem | Solution |
|---|---|
| Double-counting purchases in Events Manager | Ensure event_id in Pixel and Events API match exactly for the same event |
| Catalog feed rejections | Check that price format is "XX.XX USD" (space between amount and currency code is required) |
| Low match rate in Events Manager | Send ttclid, ip, and user_agent in addition to hashed email for maximum attribution |
| High CPMs but low click-through rate | First 2 seconds of video must be visually arresting — no logo cards or slow product reveal intros |
| Spark Ad authorization expired | Request new auth codes every 30 days; set calendar reminders for creator-authorized content |