Shopify Facebook Pixel - Suggested Improvements and Bugs

218 1 112

Currently Shopify Pixel added by the "Online Store -> Preferences -> Facebook Pixel ID" has some problems.

#1. It does not send shipping price with the value sent to "Purchase" event, causing problems in ROI. 

This causes issues for me, as the shipping value I charge my customers needs to be added to my ROI when calculating my ad spend. 

If someone could provide me a valid reason, why shipping price is not added, I'd love to hear it, but I'd assume for most shopify store owners, we would like this value to be sent.

The best solution, would be a checkbox option in the admin to allow the store owners to choose.

Looking into this issue on previous threads, this is a major issue for people who have "free products, but charge shipping" since they'll see 0 revenue in Facebook.

#2. Shopify's Facebook Pixel code does not use event_id field on FB "Purchase" events.

Sending event_id on "Purchase" would ensure that all purchases sent to Facebook are unique. It also allows Shopify customers who are using Server Side API to send data to Facebook can merge that data from their backends with Shopify's Pixel Data and also make sure it's not duplicated.

There's no downside to sending this data, and a lot of upsides. 

I would suggest that event_id be {{ }}, or {{ }}

Here's the documentation on this:

Here's what those events look like

var fbPurchase = {
contents: dlContents,
content_type: 'product',
product_catalog_id: '195868123451234',
order_id: "{{ order_number }}",
currency: 'USD',
value: {{ total_price | money_without_currency | remove: ',' }},
num_items: {{ qty }},
shop: "{{ shop.domain }}"
fbq('track', 'Purchase', fbPurchase, {'event_id': '{{ }}'});

if anyone knows how to hack shopify's "trekkie" to add this functionality or another way to implement these fixes on my store, please let me know.

Replies 15 (15)
New Member
2 0 0

The event_ID is becoming a big deal with Facebook pushing advertisers down the server side API for web (conversions API) path. 

218 1 112

I agree. Since more and more browsers are blocking pixels, it's becoming more important.

My old stores I've implemented Facebook Pixel myself, but I'd like to use Shopify's pixel as it's "easier". I've avoided it in the past, since it's functionality wasn't all there. It's pretty decent now. But I already have a script which hooks into shopify's webhooks and sends them to Facebook via Server Side API and my Facebook stats & revenue number have never been better.

Shopify needs to send event_id (and proper revenue values for that matter) for me to use their pixel.

Another reason I'd like to use their pixel is because they do not allow us access to other checkout pages which prevents us from sending "InitiateCheckout" and "AddPaymentInfo" via our own code. I've faked "InitiateCheckout" in the past by hooking this event to button presses, but it's impossible to do "AddPaymentInfo"

New Member
2 0 0

Thanks for sharing.

All of my clients use Shopify's native FB pixel setup, but we're now considering moving away from it because:

1) the issue with event ID and its impact on server-side de-duplication

2) they're really slow to make changes, e.g. CCPA. 

Those two events you mentioned (initiate checkout and add payment info) are not used by us, so it doesn't sound like we'll be losing anything by moving away from Shopify's pixel setup. It would be nice though if they bother with these.

I'm also not sure if Shopify uses manual advanced matching... it does say that they have advanced matching, but I think it's the automatic one.

218 1 112

I've looked into automatic matching.

They actually do this well. Not as good as I have implemented it, but it's 95% there. 

If you need my Shopify Webhook App to Facebook Server Side Events I'm willing to provide it. Written in nodeJS. It will require some clean up, but if you're a developer perhaps we could collab.

I'm thinking I can write a Shopify App "public app" to do this, but I was too lazy to go through their application process, so right now it's just a private app. I have it set up though, so that it will work on multiple stores.

218 1 112

Additionally with the server side API you can actually send the initiateCheckout and PaymentInfo events over to Facebook with Service Side API, because shopify has webhooks for those as well. 

I'd prefer if shopify just fixed their stuff, so I can use their apps and not have to re-implement Facebook Pixel myself, but if I don't hear from them shortly about them resolving these issues, I'll spend the time to implement the pixel myself.

Shopify Staff
Shopify Staff
140 21 32

Hey @Jordan_L,

Have you contacted support at with these items?

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog

218 1 112

Yes I have CalD. 

Didn't get anywhere. 

They said post in the community. So I'm here.

New Member
1 0 0

Hi @Jordan_L  Thanks a lot for all the great information you posted. 

I am trying to figure out what would be the best way to add the event_id parameter to facebook pixel (native. Not Shopify integration) so t will match the event_ID that will be passed when 

will implement the S2S solution for my Shopify store.

Also, Do I have control over what value would be populated on the api call for Event ID? Can I use there what you have suggested {{ }} .

In Other words- Can I make sure that the pixel and S2S events both report on same Event_id?

I am unsure about how do I add the event_id attribute to the pixel. Can I just add it as a normal parameter?

I know my questions are pretty basic, but this API implementation is new to me. 



New Member
1 0 0

We are trying to find the solution to the same issue but no luck. Were you able to resolve this somehow?

New Member
2 0 1

Hi Guys!


Anyone has any solution to this? I'm a non developer and trying to figure out how to make this work. 

I'm using Zapier as they are offering some integration now for purchase, but the deduplication doesnt seems to be working and returning me back 2 purchase data instead of one on facebook ads.

Is it due to this event id ?



218 1 112

Yes, event_id is required to de-duplicate as I understand it.

New Member
1 0 0

@Jordan_L - I would be interested in taking a look at the script you are using for FB S2S integration. Are you running your own server in the background to run the script and send API events, or are the API events sent directly from shopify?

I am new to shopify, but have been a developer for over 15 years. Would be interested in collaborating as I am also trying to solve the event_id issue for facebook pixel. Seems the only way to do that currently is to remove the shopify FB integration and manually configure the pixel events in each page.

New Member
1 0 0

Hello @Jordan_L!

I'm currently having all the issues you have + my Payment provider does not redirect customers to the `/thank_you page`. So it looks like the only way I can achieve Purchase tracking is to use SHopify webhooks. 

Could you please share your code with me? I'm a Ruby developer so want to do some kind of port of your code from NodeJS to Ruby if that works for you.

Thank you.

New Member
2 0 0

Hey Jordan (& others)! 🙂

Facebook is referring to the EVENT_ID in their documentation, so I'd suggest using {{ checkout.order_id }} and pass that.

I saw that this thread was a couple of months old but just wanted to let you know that both Facebook & Shopify came a long way with this issue by now.

I've written a pretty easy guide on how to set up the Conversions API using the no-code tool Integromat:

The intention of that post is to show that it shouldn't require any coding skills to set it up. It's a fairly simple setup using:

  1. Shopify "New Order" Webhook
  2. Integromat Webhook catcher
  3. Facebook API Credentials

Let me know if that helps or it leaves you with additional questions 🙂

New Member
3 0 3

Has anyone managed to find a fix to this problem?