I'm having Issues Integrating Partytown with WordPress for Google Tag Manager Optimization

I'm trying to optimize my WordPress site's performance by offloading Google Tag Manager (GTM) scripts using Partytown. I've installed Partytown via npm and set up the necessary configuration, but I'm encountering several issues: TypeError: ServiceWorker script at https://edgetechcontrols.com/~partytown/partytown-sw.js for scope https://edgetechcontrols.com/~partytown/ encountered an error during installation. Uncaught TypeError: Partytown.load is not a function I installed the partytown.js package with npm and get these type errors and can't configure the library correctly. I also copied the lib files to a different directory thinking that could maybe help with the reference and type error issues I've been getting. Are there any better solutions than partytown.js? I've created web workers in the past but GA scripts depend on the window api so, I can't add them to the worker 'thread'. Any tips or alternative technology suggestions would be great. thanks

Comment (0)

You’ll be in good company