Loading...
Loading...
Sync your catalog to Instagram, TikTok, and Facebook to enable shoppable posts and in-app checkout directly from your social content
npx skill4agent add finsilabs/awesome-ecommerce-skills social-commerce| Platform | Setup Via | In-App Checkout | Best For |
|---|---|---|---|
| Instagram Shopping | Meta Commerce Manager | Yes (US only) | Fashion, beauty, lifestyle |
| Facebook Shop | Meta Commerce Manager | Yes (US only) | All categories |
| TikTok Shop | TikTok Seller Center | Yes | Viral/impulse products |
| Pinterest Shopping | Pinterest Ads Manager | No (links to your store) | Home, fashion, food |
import { XMLBuilder } from 'fast-xml-parser';
export async function generateMetaCatalogFeed(req: Request, res: Response) {
const products = await db.products.findAll({
where: { status: 'active', availableForSale: true },
include: ['variants', 'images'],
});
const items = products.flatMap((p) =>
p.variants.map((v) => ({
id: v.sku, // Use SKU as the catalog item ID — must be stable
title: p.name,
description: p.description.slice(0, 9999),
availability: v.inventory > 0 ? 'in stock' : 'out of stock',
condition: 'new',
price: `${(v.priceInCents / 100).toFixed(2)} USD`,
link: `${process.env.STORE_URL}/products/${p.slug}?variant=${v.id}`,
image_link: p.images[0]?.url,
brand: p.brand ?? process.env.STORE_NAME,
google_product_category: p.googleProductCategory,
item_group_id: p.id, // Required: groups variants together in Meta
color: v.color,
size: v.size,
}))
);
const builder = new XMLBuilder({ arrayNodeName: 'item', ignoreAttributes: false });
const xml = builder.build({ rss: { channel: { item: items } } });
res.setHeader('Content-Type', 'application/xml');
res.setHeader('Cache-Control', 'public, max-age=3600');
res.send(xml);
}// Push individual product updates immediately when price or inventory changes
async function pushProductUpdateToMeta(variantSku: string, inventory: number, priceInCents: number) {
await fetch(`https://graph.facebook.com/v18.0/${process.env.META_CATALOG_ID}/items_batch`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
access_token: process.env.META_ACCESS_TOKEN,
item_type: 'PRODUCT_ITEM',
requests: [{
method: 'UPDATE',
retailer_id: variantSku,
data: {
availability: inventory > 0 ? 'in stock' : 'out of stock',
price: `${(priceInCents / 100).toFixed(2)} USD`,
},
}],
}),
});
}| Metric | Where to Find |
|---|---|
| Revenue from Instagram Shopping | Meta Commerce Manager → Analytics → Sales |
| Revenue from TikTok Shop | TikTok Seller Center → Analytics |
| Product tag click-through rate | Meta Business Suite → Content → Posts |
| Catalog item rejection rate | Commerce Manager → Catalog → Diagnostics |
item_group_id| Problem | Solution |
|---|---|
| Products stuck "under review" in Instagram Shop | Ensure product images show the item clearly with no overlaid text; review Meta's Commerce Policies for prohibited categories |
| Price mismatch error in Meta | The price in your feed must exactly match the price on the landing page; if running a sale, update both simultaneously |
| TikTok catalog items not appearing in TikTok Shop | TikTok requires separate Seller Center account approval — catalog sync is not sufficient; apply for TikTok Shop separately |
| Product tags not showing on Instagram posts | Your Instagram Shop must be approved before tagging works; check Instagram → Settings → Business → Shopping for status |
| Feed URL returns 403 after deployment | Add the Meta crawler's IP range to your CDN allowlist, or ensure the feed URL is publicly accessible without authentication |