Open aldoarya opened 2 years ago
updated:
AdBlock is blocking Facebook pixel
work for me
Hello, I have the same problem, but it is not due to ad-block.
It seems the tracking is working and the issue is with the Facebook Pixel Helper extension not detecting the events when the fetch is proxied through a service worker, the small problem is you can't force a request not to be proxied through the service worker if you want to debug with the facebook pixel helper
The only way as you've found is to do a forced page reload
But the tracking should still be working if proxied as NetworkOnly
I have found a workaround, the issue really comes from the facebook pixel helper extension not listening in on service workers, but you can enable Bypass for network
which allows the extension to work.
Some adblockers also have the same issue and if you only allow it on the page they will still block the service worker's fetch, this workaround will work for that as well
Summary
We are using this library to use PWA in our web app. In the other hand, our team also use Facebook Browser Pixel to track events that our user do. When tested individually, both are working normally. But when doing end-to-end test and both tested together, the Facebook Browser Pixel isn't firing any event. We checked on Facebook Event Manager and Facebook Pixel Helper, both doesn't receive any event.
The event is actually fired and tracked in Hard Reload (Ctrl + F5) or first time user visit, but when we do normal reload or user revisit the page, the Facebok Pixel doesn't work again.
Investigating on Network tab on Developer Tools, I think that the service worker might be intercepting request to Facebook. We already tried to use NetworkOnly strategy for Facebook Pixel, but it's still not working.
How To Reproduce
Steps to reproduce the behavior:
Expected Behaviors
Facebook Pixel not intercepted by service worker and able to succesfully fire and track event.
Version
next-pwa
: 5.2.24next
: 9.4.4Screenshots
next.config.js
cache.js Added this line beside the default cache.js