Fix guide · Shopify · medium · about 30 min
Facebook click ID (fbclid) lost on Shopify
For the finding “Click ID from Meta ads is not stored”. Also for: Any website, WordPress, Webflow, Framer.
What this means
When someone clicks a Meta ad, Meta adds ?fbclid=... to the link. The Meta Pixel (still often called the Facebook Pixel) on your store should save it in the first-party cookie _fbc, so later events (an add to cart, a purchase) can be tied back to the ad click. On your store, the click ID did not end up in _fbc.
Why it costs you money:
- Meta has a weaker link between ad clicks and conversions, which lowers event match quality and can lower reported results.
- Campaigns optimize on less complete data, so you may pay more per result.
- If you send server events through the Conversions API, they usually rely on the same
_fbcvalue, so they lose it too.
How to confirm it yourself
Our check opens your page in a browser in the EU as if the visitor arrived from a Meta ad, accepts the cookie banner and looks for _fbc. If our report shows a redirect chain, start there: it often shows where the click ID was dropped.
- Open a private (incognito) window, open developer tools (F12) on Network, and tick Preserve log so redirects stay visible.
- Open the exact URL your ads use, with a made-up click ID added:
https://yourstore.com/products/example?fbclid=test123. (This sends a normal page view to your own pixel. It does not create an ad click.) - If one of the first requests is a redirect (
301,302,307,308), click it and check its Location header. Does the new address still contain?fbclid=test123? - Accept the cookie banner and wait a few seconds. Where consent is required, the Facebook & Instagram app’s pixel waits for it, so
_fbcmay appear only after you accept. - Go to Application > Cookies (Chrome) or Storage > Cookies (Firefox), select your domain and look for
_fbc. It should look likefb.1.<timestamp>.test123. You should also see_fbp, the pixel’s browser ID.
If _fbc is missing or does not end with your test value, the click ID is being lost.
How to fix
- Point your ads at the final address. Your primary domain is set under Settings > Domains; your other domains, including the
.myshopify.comaddress, redirect to it. In our tests on Shopify stores, these redirects (alsohttptohttps, and with or withoutwww) and Shopify’s market redirects to a country folder (for example/en-de) kept the query string, includingfbclid. Still use the exact final address in every ad (primary domain,https, and the market folder if you use one), so visitors land without a redirect. - Test automatic redirection for your markets. If automatic redirection is on (Online Store > Preferences), visitors may be sent to another domain or folder for their country. Open your ad URL with
?fbclid=test123through a VPN in each of your main markets and check that the click ID survives. - Check Shopify URL redirects. Redirects under Content > Menus > View URL redirects only work for addresses that no longer exist, and Shopify notes that URLs with query strings might not work as expected. If an ad points to an old address, change the ad to the current page.
- Check redirects outside Shopify and in apps: domain forwarding at your registrar, link shorteners, link-in-bio pages, and apps that send visitors to another address (country selectors, A/B tests, age checks). These are common places where the query string is dropped.
- Make sure the pixel runs on the landing page after consent.
_fbcis written by the pixel. When a visitor accepts, Shopify starts the app pixels that were waiting for consent and replays the events that already happened on the page, so the Facebook & Instagram app’s pixel should store_fbcwhilefbclidis still in the address. If the pixel does not fire after “Accept” at all (often because a consent app is not connected to Shopify’s Customer Privacy API), see “Meta Pixel not firing after cookie consent on Shopify”. - Check the pixel uses first-party cookies. In Meta Events Manager, open Data sources, select your pixel and open Settings. Under Cookie settings, Cookie usage shows whether first-party cookies are on (they are on by default). If they were turned off, click Edit, turn First-party cookies on and save.
- If your Meta pixel runs in a custom pixel (directly or through GTM), it runs in Shopify’s sandbox frame. Use the test above to check that
_fbcstill ends up on your store’s domain. If it does not, use the Facebook & Instagram app’s pixel instead (and remove the custom pixel, so events are not sent twice). - Check your consent app does not delete the cookie. Some consent tools delete marketing cookies they consider unapproved. After “Accept”,
_fbcshould stay.
Common causes
- Ads link to an address that goes through a redirect outside Shopify (registrar forwarding, a link shortener, a link-in-bio tool) that drops the query string.
- An app redirects visitors to another page or country version without keeping the query string.
- An ad points to an old address that relies on a URL redirect.
- The pixel never fires after consent on the landing page, so it never reads
fbclid. - First-party cookies are disabled for the pixel.
How to verify the fix
- Repeat the test above with the exact ad URL: no redirect drops
?fbclid=test123, and after accepting cookies_fbcends withtest123. - Open another page of the store:
_fbcis still there. - Re-run the check on IsPixelWorking. The issue should be gone, and the redirect chain in the report (if any) should keep the click ID.
Sources
- Meta for Developers, ClickID and the fbp and fbc parameters (cookie format, 90-day lifetime, the pixel stores the click ID in
_fbc): https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc - Meta Business Help Center, Check your Meta Pixel cookie settings: https://www.facebook.com/business/help/560982207646475
- Meta Business Help Center, About cookie settings for the Meta Pixel: https://www.facebook.com/business/help/471978536642445
- Shopify Help Center, Change your primary domain (other domains redirect to the primary domain): https://help.shopify.com/en/manual/domains/domain-type/change-primary-domain
- Shopify Help Center, Set up automatic storefront redirection for your customers: https://help.shopify.com/en/manual/markets/automatic-redirection
- Shopify Help Center, Creating and managing URL redirects (broken URLs only; query strings): https://help.shopify.com/en/manual/online-store/menus-and-links/url-redirect
- Shopify.dev, About web pixels (pixels run after consent and earlier events are replayed; custom pixels run in a sandbox iframe): https://shopify.dev/docs/apps/build/marketing/pixels
- Shopify Help Center, Pixels overview: https://help.shopify.com/en/manual/promoting-marketing/pixels/overview