Install the Meta Pixel template in web GTM
GTM web → Templates → Search Gallery → 'Facebook Pixel' by facebookincubator → Add. Then Tags → New → Facebook Pixel. Paste Pixel ID. Action: Init & Send PageView. Trigger: All Pages.
The full 2026 setup: browser Pixel via GTM web, server-side Conversions API via sGTM, event deduplication via event_id, hashed customer data, and an Event Match Quality ≥ 7.
GTM web → Templates → Search Gallery → 'Facebook Pixel' by facebookincubator → Add. Then Tags → New → Facebook Pixel. Paste Pixel ID. Action: Init & Send PageView. Trigger: All Pages.
Every time your site pushes a conversion event into the dataLayer, generate a UUID and include it. This is what dedupes Pixel and CAPI.
function uuid() {
return crypto.randomUUID
? crypto.randomUUID()
: ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));
}
window.dataLayer.push({
event: "purchase",
event_id: uuid(),
ecommerce: { /* as per GA4 guide */ },
user_data: {
email: "customer@example.com", // raw — Pixel hashes
phone: "+447700900000",
first_name: "Luke",
last_name: "Trevillion"
}
});One Facebook Pixel tag per standard event. Action: Track Custom. Event name: Purchase (Meta's casing). Object Properties: map value, currency, content_ids, contents, num_items. Pass eventID = {{dlv - event_id}}. Trigger: CE – purchase.
Open the Facebook Pixel template → tick Enable First-Party Cookies. Then in More Settings → Server Container URL, paste your sGTM endpoint (e.g. https://sgtm.yourdomain.com). This forwards browser events to your sGTM container.
sGTM → Templates → Search Gallery → 'Conversions API Tag' by facebookincubator. Add it.
Tags → New → Conversions API Tag. Paste your Pixel ID + Access Token (generate in Events Manager → Settings → Conversions API → Generate access token).
Event Name: Purchase. Set Event Data → Inherit from event data.
Map user data fields: em, ph, fn, ln, fbc (from _fbc cookie), fbp (from _fbp cookie), client_ip_address, client_user_agent, event_id.
em/ph/fn/ln for you — pass raw values.sGTM triggers fire off the event the Pixel Data Tag forwarded. Create a trigger: Custom Event, name matches the Pixel event (Purchase). Bind to your Conversions API tag.
Repeat for AddToCart, InitiateCheckout, Lead.
Events Manager → your pixel → Test Events. Open your site → complete a test purchase. You should see TWO entries that quickly collapse into ONE deduplicated event (badge: Deduplicated). Click into the event → Event Match Quality. Aim for ≥ 7.0.
Low EMQ usually means missing IP/UA forwarding, missing em/ph hashing, or unnormalised inputs (caps in emails, formatted phones).