Why aren't my Facebook, TikTok, and Pinterest pixels firing correctly?

Why aren't my Facebook, TikTok, and Pinterest pixels firing correctly?

martama
New Member
4 0 0

Hi,

I added Facebook, TikTok, and Pinterest pixels to my store, (https://pastelmaison.com/) but they are not firing.

Interestingly, when checking the store in preview mode (like from product drafts preview) they work correctly.

Also, wrt Facebook pixel it fires on Safari too.

 

By checking Chrome Console in developer tools I see this error message, which doesn't appear in the preview mode.

Uncaught TypeError: ShopifyAnalytics.lib.generatePageObject is not a function
    at prod-custom-checkout-v2.js?shop=f2ebd2.myshopify.com:41:37
    at prod-custom-checkout-v2.js?shop=f2ebd2.myshopify.com:184:3
(anonymous) @ prod-custom-checkout-v2.js?shop=f2ebd2.myshopify.com:41
(anonymous) @ prod-custom-checkout-v2.js?shop=f2ebd2.myshopify.com:184

It seems to be caused by trekkie.ready never being called:

var loaded = false;
  trekkie.ready(function() {
    if (loaded) return;
    loaded = true;

    window.ShopifyAnalytics.lib = window.trekkie;

I tried with the debugger and the function is never called (while it's called in preview mode).

Can anyone help me understand how to fix this?

 

I know a bit of coding, but I am no Javascript expert, so I am blocked...

Thanks for your help!

Replies 0 (0)