How to add web workers in react components for 3rd party scripts like google tag manager etc..

I have been trying to implement web workers in our static page when I implemented the web workers the main thread got increased to 16SEC and for mobile main thread taking 8SEC and adding few more script's to worker file it's increasing more work thread process I'm no able to figure it out can anyone help me in this ? for both mobile and desktop version it's been different. Thank you in Advance.
11 Replies
Jochem
Jochem2y ago
I have no direct experience with this issue, or this library, but I've heard others talk about it and generally they're very positive. It might be worth taking a look at Partytown https://partytown.builder.io/
Partytown
Introduction - Partytown
Partytown - Run third-party scripts from a web worker
Jochem
Jochem2y ago
the elevator pitch says it's hardly more work than adding a script tag to head, and adding a custom attribute to external scripts you want to run in a webworker
Kiran
KiranOP2y ago
Hi @jochemm i have implemented partytown in my web app but few trackers were getting blocked the trackers i have used like Facebook event , GTM , some related to our project
Kiran
KiranOP2y ago
how can i solve this kind of blocking issues ?
Kiran
KiranOP2y ago
https://script.mfilterit.net/ even this tracker getting blocked
Kiran
KiranOP2y ago
Kiran
KiranOP2y ago
Could you please help how can i resolve this issue ?
Jochem
Jochem2y ago
sorry, I'm not really familiar with how partytown actually works, I haven't used it. Do those requests work without having the scripts run through partytown, just as a test?
Kiran
KiranOP2y ago
yeah they are running yeah thank you very much thumbupthanks
Jochem
Jochem2y ago
it's potentially still worth checking if partytown has any info on this, see if there's a setting or maybe they've got a discord or something else you can ask on
Kiran
KiranOP2y ago
yeah I'll try on that and check thanks for your time
Want results from more Discord servers?
Add your server