Facebook Conversions API for Shopify with Google Tag Manager

Analytics Mania
Analytics ManiaMar 31, 2026

Why It Matters

Server‑side CAPI integration ensures accurate Facebook conversion data despite browser blockers, giving Shopify merchants stronger ROI measurement and compliance.

Key Takeaways

  • Set up server‑side GTM via Stape to forward events.
  • Create data tags for page view, add‑to‑cart, purchase.
  • Map Shopify data layer variables to Facebook CAPI parameters.
  • Use event IDs to deduplicate pixel and server events.
  • Test with preview mode and decode Base64 payloads.

Summary

The video walks through a complete end‑to‑end configuration that connects a Shopify store to Facebook’s Conversions API using a server‑side Google Tag Manager (GTM) container hosted on Stape. It shows how the web GTM container, a Stape data tag, and the server‑side container work together to forward e‑commerce events directly to Facebook, bypassing browser limitations.

The presenter creates three core data tags—page view, add‑to‑cart, and purchase—by importing Stape’s data‑tag template, setting a constant variable for the server‑side URL, and assigning appropriate triggers (DOM Ready for page view, custom events for the others). He then maps Shopify’s e‑commerce data layer variables (currency, value, content IDs, contents) to the format required by the Conversions API, using a custom “universal conversions” variable template to reshape arrays into Facebook’s expected structure.

A key illustration is the use of event IDs to deduplicate events when both the pixel and server‑side calls fire, ensuring accurate reporting even if a browser extension blocks the pixel. The tutorial also demonstrates decoding the Base64‑encoded payload in the server‑side preview to verify that the correct product IDs, prices, and transaction IDs are transmitted.

By moving conversion tracking to the server, merchants gain more reliable data, comply with emerging privacy regulations, and improve ad attribution on Facebook. The step‑by‑step guide reduces the technical barrier for Shopify owners, allowing them to capture complete purchase funnels without relying on fragile client‑side scripts.

Original Description

Setting up Facebook Conversions API for Shopify is a bit complicated. It requires a specific approach for accurate tracking. This tutorial provides a step-by-step guide on how to implement Facebook CAPI for Shopify using server-side Google Tag Manager.
You’ll learn:
- How to configure the Data Tag to send e-commerce events to your server container.
- How to set up the Facebook Conversions API tag to process page views, add-to-carts, and purchases.
- A method for deduplicating events when using both a browser pixel and a server-side setup.
- How to send user data like email addresses to improve event matching quality.
=== TIMESTAMPS ===
00:00 - Intro
00:11 - Server-side tracking setup
02:27 - Tracking page views
11:03 - Purchase events
17:15 - Creating Facebook CAPI tags
33:32 - Implementing Event IDs for deduplication
38:22 - Final Words
=== LINKS ===
✭ Sign up for Stape
📌 FREE e-books on Google Tag Manager and Google Analytics 📌
⭐⭐ Google Tag Manager and Google Analytics 4 courses ⭐⭐
✭ Universal Conversions variable (website)
✭ Universal Conversions variable (server)
✭ Data Client for Google Tag Manager (server)
=== CONNECT WITH JULIUS & ANALYTICS MANIA ===
#googleanalytics #googleanalytics4 #ga4 #googletagmanager

Comments

Want to join the conversation?

Loading comments...