Custom Facebook Pixel implementation and GTM

ib3
New Member
3 1 1
Hi there

Scratching my head for far too long with this one.

I look after a custom theme for a client who has a Shopify Plus store. They currently have their Facebook Pixel ID added through the admin settings, but the tracking for Add to cart does not work properly. The theme uses Ajax calls for the cart, showing of pop ups with product details and an add to cart as well as custom code for selecting and displaying variants from drop downs. The built in integration does work for the other events and curiously, the add to cart event does work properly on pages where there are no variants and no popups, even though the cart add is done via ajax.

Anyway, since I don't know how Shopify have implemented this tracking or how I can fix it, it looks like I will need to roll my own solution.

If I remove the Facebook Pixel ID from the back end, is it just those tracking events listed in the documentation that will no longer work, or is there a wider consideration of things that will break?

I'd like to have the pixel code implemented in Google Tag Manager, and tap in to the dataLayer/Shopify's JS objects, but it's written clear in the documentation NOT to use GTM for Analytics and Facebook Pixel. Why is this? If I'm not using Shopify's FB pixel implementation then why does it matter how i implement mine? Is there any technical or legal reasoning behind this?

TIA
Jamie
0 Likes
jordan_lume
New Member
3 0 0

Talking to Shopify support, they say "It is a support factor - Shopify can support Facebook Pixel regarding standard events, and the Facebook Channel, but are unable to support non-standard integrations like those directly added to the theme code or via JavaScript"

So I don't think there's any reason why you can't use GTM to implement, except that you are on your own if things break.

Did you end up implementing through GTM? If so, have you been successful? I need to move off of the Shopify Facebook integration, but want to be very careful

0 Likes
BananaMoon
Excursionist
18 1 1

Hello,

I think (only my own belief), that there might be a conflict between Facebook Pixel IDs (one from Shopify and the other from JS or API).

These kind of errors are not logged in Google Chrome, for example (duplicate cookie or local.browser.cache).

Nope, removing Facebook pixels is not at all breaking down, but you should make sure all tags and reference works well with this tracking pixel - to do a clean slate.

(And maybe clean a bit template files)

For reference, now GTM is used as main tracking cookie if you use the Google integration inside Shopify.

Regards,

 

0 Likes
BananaMoon
Excursionist
18 1 1

For reference, now GTM is used as main tracking cookie if you use the Google integration inside Shopify.

It means a duplicate cookie can occur if you use both (custom cookie & Google cookie).

0 Likes