You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Page speed insights is complaining about Google Analytics module blocking the main thread. I figured that Partytown web worker can help avoid blocking the main thread when using analytics.
Is there any chance it could be supported out of the box?
The text was updated successfully, but these errors were encountered:
Adding support for Partytown is fairly straightforward.
It's a matter of setting a special type for the gtag script and notifying Partytown.
exportconstload=(url,options={})=>{returnnewPromise((resolve,reject)=>{if(typeofdocument==="undefined"){return;}consthead=document.head||document.getElementsByTagName("head")[0];constscript=document.createElement("script");/* ... */if(options.partytown){script.type='text/partytown';// mark the script for partytown}head.appendChild(script);if(options.partytown){window.dispatchEvent(newCustomEvent('ptupdate'));// trigger partytown rescan}/* ... */});};
Page speed insights is complaining about Google Analytics module blocking the main thread. I figured that Partytown web worker can help avoid blocking the main thread when using analytics.
Is there any chance it could be supported out of the box?
The text was updated successfully, but these errors were encountered: