🎯 Meta Ads Attribution Guide

How to Pass fbclid and _fbc Cookies from WordPress to Shopify Checkout

By Dimsquid EngineeringPublished Aug 5, 20268 min read

If your marketing stack relies on a WordPress content hub or landing page builder (Elementor, Divi, Gutenberg) to drive traffic to a separate Shopify checkout domain (checkout.myshopify.com), you are likely losing up to 40% of your Meta (Facebook & Instagram) ad conversion attribution. This in-depth technical guide explains how Meta click identifiers work across domains and how to pass fbclid, _fbc, and _fbp cookies automatically.

1. The Symptom: Facebook Ad Conversions Showing $0 ROAS & Low Event Match Quality

When a user clicks on your Facebook or Instagram ad, Meta appends a unique Click ID string to the URL: ?fbclid=IwAR2xyz.... The Meta Pixel running on your WordPress site captures this parameter and creates a first-party cookie named _fbc.

However, when that customer clicks your "Buy Now" button and navigates to your Shopify store, the Meta Pixel on Shopify looks for the _fbc cookie. Because browser security rules isolate cookies to the originating origin (yourbrand.com vs checkout.myshopify.com), Shopify's Meta Pixel sees a completely empty browser state.

🚨 Broken Meta Attribution Diagnostic Checklist:
  • Meta Ads Manager shows 0 Purchase events while Shopify orders increase.
  • Event Match Quality (EMQ) score drops below 4.0 out of 10.
  • Shopify analytics reports sales coming from Direct / (none) instead of Facebook Ads.
  • Ad optimization algorithms fail to optimize for high-value purchasers.

2. The Cause: First-Party Cookie Origin Isolation

To understand why fbclid disappears, let's examine how modern web browsers enforce SameSite and Same-Origin privacy boundaries:

1. Visitor Clicks Meta Ad ➔ Lands on WordPress:
URL: https://yourbrand.com/landing-page?fbclid=IwAR999...
Cookies set on yourbrand.com: _fbc=fb.1.1670000000.IwAR999; _fbp=fb.1.1670000000.987654
2. Visitor Clicks Outbound Checkout Link:
Target Href: https://checkout.myshopify.com/cart/add?id=123
3. Shopify Domain Browser Execution:
Cookies accessible on checkout.myshopify.com: NONE (_fbc & _fbp blocked by domain isolation!)

Unless your outbound links actively append _fbc and _fbp parameters directly onto the URL, Meta's Conversions API and Meta Pixel are forced to treat the customer as an anonymous direct visitor.

3. The Hard Way: Custom GTM JavaScript Listeners

Store owners often attempt to patch this issue by writing custom Google Tag Manager (GTM) scripts. Below is an example of what developers typically write to extract and pass Meta cookies manually:

// Manual GTM Link & Cookie Decorator (Brittle & High Maintenance)
(function() {
  function getCookie(name) {
    var value = "; " + document.cookie;
    var parts = value.split("; " + name + "=");
    if (parts.length === 2) return parts.pop().split(";").shift();
  }

  document.addEventListener("click", function(event) {
    var target = event.target.closest("a");
    if (!target || !target.href.includes("myshopify.com")) return;

    var fbc = getCookie("_fbc") || new URLSearchParams(window.location.search).get("fbclid");
    var fbp = getCookie("_fbp");

    var url = new URL(target.href);
    if (fbc) url.searchParams.set("_fbc", fbc);
    if (fbp) url.searchParams.set("_fbp", fbp);
    target.href = url.toString();
  });
})();
Why Manual GTM Fails in Production:
  • Fails on dynamic AJAX slide-out cart drawers that load buttons after initial page load.
  • Does not support HTML <form action="..."> submit buttons.
  • Breaks whenever WordPress themes or page builders update their DOM structure.
  • Does not forward TikTok ttclid or GA4 _gl cross-domain tokens.
⚡ Automated Solution

4. The 60-Second Fix: GA4 & Ad Pixel Linker Plugin

GA4 Linker (by Dimsquid) solves cross-domain ad pixel tracking out-of-the-box. It automatically captures incoming Meta (fbclid, _fbc, _fbp), TikTok (ttclid, _ttp), and GA4 (_gl) session parameters and appends them to all outbound Shopify checkout links.

🔍 Built-in Admin Attribution Health Audit Scanner:
Meta Pixel Cookie (_fbp):✅ Active & Forwarding
TikTok Click Identifier (ttclid):✅ Active & Forwarding
GA4 Cross-Domain Token (_gl):✅ Active & Forwarding

Related Attribution Guides: