Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Would you consider using PartyTown to load the gtm script? #282

Open
carlos-algms opened this issue Oct 10, 2022 · 3 comments

Comments

@carlos-algms
Copy link

To get better performance and higher Lighthouse scores, it is possible to delegate the third-party scripts to web workers.

That's where PartyTown comes into place.

https://partytown.builder.io/nextjs

@MauricioRobayo
Copy link
Owner

Hello @carlos-algms , this is a great idea. Let's leave the issue open to see if it gathers some traction, and if so, I'll be happy to work on it or let anyone else do it.

@M1ck0
Copy link

M1ck0 commented Oct 30, 2022

This should definitely be done, as the script will be offloaded to the service-worker on a different thread.

+1

@SushiWaUmai
Copy link

SushiWaUmai commented Jan 6, 2023

I think this is not really necessary, since Next.js scripts already have experimental support for PartyTown.

https://nextjs.org/docs/basic-features/script#offloading-scripts-to-a-web-worker-experimental

Edit: I just found out that we need to change some things in order for partytown to communicate with google analytics, so there needs to be some minor changes in order for it to work with webworkers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants