New Shopify Certification now available: Liquid Storefronts for Theme Developers

Facebook Pixel registering Add to Cart twice

kenssyo
Visitor
3 0 3

Hello,

For a while I'm seeing that my Facebook Pixel is receiving the Add to Cart action twice.

The parameters seems to be different though:

Parameters: (6)
  • value: 99.99
  • currency: RON
  • content_ids: ["6604002361494"]
    This content ID matches to one or more of your catalogs.
  • content_type: product_group
  • content_name: Tinuta Theo - S/M
  • content_category:
Action Source: website
Advanced Matching Parameters: IP Address, User Agent
 
vs.
 
Parameters: (7)
  • value: 99.99
  • currency: RON
  • content_ids: ["6604002361494"]
    This content ID matches to one or more of your catalogs.
  • content_type: product_group
  • content_name: Tinuta Theo - S/M
  • content_category:
  • num_items: 1
Action Source: website
Advanced Matching Parameters: IP Address, User Agent
 
The only extra parameter seems to be "num_items" but I cannot understand where this is comming from. 
I checked all the theme code files for anything that would suggest sending code to pixel when adding to cart but found nothing.
 
Any ideas?
Replies 2 (2)
Josh_Uebergang
Shopify Expert
1003 42 264

Yup, I tested that product page and see the double fire of that event with the only difference as well being the number parameter. Looking at the source code, it seems you're running Shopify's native pixel solution? Are you using the new Facebook channel rather than the old pixel setting installed outside the channel?

To help debugging, I suggest testing it on the very original version of your theme to see if changes you made or it's an issue with the original developer. Ideally you get to a point where the issue doesn't occur. It's possible some script while adding to cart is causing it to run twice.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
kenssyo
Visitor
3 0 3

Hello,

Thank you for your reply.

Yes, I'm running the native Shopify pixel feature, added only the code in Preferences and didn't added any code in Additional Scripts (Checkout).

I'm using the new Facebook channel, used the old one in the past. In this new one I also have the Pixel added in Setting -> Data sharing settings.

But I'm thinking that if there was an issue that I have the pixel in both Online Store -> Preferences and Facebook -> Settings -> Data sharing settings, all action would be registered twice and not only the Add to Cart...

 

Looking at the source code also, I was looking for the extra variable, found some mentions in trekkie.storefront and fbevents. 

As far as I understood, trekkie is from Shopify and obviously, fbevents is from Facebook.

I will try to check whether any of these triggers twice something that contains num_items.

 

I've already tried adding the changed themes files in a dedicated compare tool but haven't seen anything that would suggest adding to cart should trigger anything.

But will try again, reverting the theme changes to original.

 

Can this be an issue on Facebook Pixel side and not on Shopify settings or this would have implied that I see double values only in FB Pixel screen and wouldn't see it trigger twice in my Shopify page?