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
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/
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
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
how can i solve this kind of blocking issues ?
https://script.mfilterit.net/ even this tracker getting blocked
Could you please help how can i resolve this issue ?
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?
yeah they are running
yeah thank you very much
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
yeah I'll try on that and check
thanks for your time