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

[🐞] High Total Blocking Time (TBT) using Google Analytics and partytown #513

Open
benmccann opened this issue Dec 16, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@benmccann
Copy link
Contributor

benmccann commented Dec 16, 2023

Describe the bug

Screenshot from 2023-12-26 09-05-03

Screenshot from 2023-12-15 22-33-37

I don't know if this is purely unavoidable. However, it surprised me as I thought Partytown was supposed to move all computations off the main thread.

My page speed score is a couple of points better without Partytown + GA. However, Partytown + GA is still several points better than GA alone.

Reproduction

https://partytown.builder.io/google-tag-manager

Steps to reproduce

Setup Google Analytics with Partytown. E.g. I followed https://partytown.builder.io/sveltekit

Then use https://pagespeed.web.dev/ (look under "Avoid long main-thread tasks") or https://webpagetest.org/ to see that Partytown is significantly blocking the main thread.

Browser Info

Chrome

Additional Information

No response

@benmccann benmccann added the bug Something isn't working label Dec 16, 2023
@benmccann
Copy link
Contributor Author

Looks like Lighthouse has gotten stricter on its scoring. That amount of blocking time is now taking 7 points of the Lighthouse score

Screenshot from 2024-01-09 08-09-52

@gioboa
Copy link
Collaborator

gioboa commented Jan 9, 2024

Can you try with the new release pls? Thanks

@benmccann
Copy link
Contributor Author

Thank you for taking a look. Unfortunately no improvement

Screenshot from 2024-01-09 14-13-37

@gioboa
Copy link
Collaborator

gioboa commented Jan 9, 2024

Here is my result. This is your website, right?

Screenshot 2024-01-09 at 23 36 36

@benmccann
Copy link
Contributor Author

Yes, that's my site that I've been testing with. The overall score is somewhat variable with some runs doing better than others. Obviously the site scores well overall, but I can't help but want to get to 100 😁 Probably the most useful piece to look at rather than the overall score is the "Avoid long main-thread tasks" section and see whether Partytown is listed there as contributing to Total Blocking Time. My expectation was that Partytown shouldn't block, but I have limited insight into the internals, so perhaps there's some reason it's not possible for Partytown to operate in a non-blocking way.

@stefan9541
Copy link

have the same issue, in my case overall TBT by partytown-sandbox-sw.htm same as I had with Google Analytics and google-tag-manager scripts together)

@SkyZeroZx
Copy link

I had the same issue with TBT when integrated G4 with Angular & Partytown

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants