Shopify Facebook Pixel - Suggested Improvements and Bugs

Jordan_L
Trailblazer
216 1 108

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 {{ order.name }}, or {{ order.id }}

Here's the documentation on this:
https://developers.facebook.com/docs/marketing-api/conversions-api/deduplicate-pixel-and-server-even...

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': '{{ order.name }}'});

 
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.

ridethespiral
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. 

0 Likes
Jordan_L
Trailblazer
216 1 108

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"

0 Likes
ridethespiral
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.

0 Likes
Jordan_L
Trailblazer
216 1 108

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.

Jordan_L
Trailblazer
216 1 108

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.

0 Likes
CalD
Shopify Staff
Shopify Staff
90 8 12

Hey @Jordan_L,

Have you contacted support at https://help.shopify.com/en/questions 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 Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
Jordan_L
Trailblazer
216 1 108

Yes I have CalD. 

Didn't get anywhere. 

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

0 Likes
AssiBB
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 {{ order.id }} .

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. 

Thanks,

Assi

0 Likes
mohitdxb
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?

0 Likes