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: performance improvements + package moving #87

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

tg666
Copy link
Contributor

@tg666 tg666 commented Aug 30, 2024

  • Widget initialization without waiting for DOMContentLoaded event.
  • INP metric performance improvement.
  • Moved package to @68publishers/cookie-consent

tg666 added 2 commits August 30, 2024 05:29
- updated GTM template - added new option "Init widget after DOMContentLoaded" which is by default `false`
- the widget is now by default initialized as soon as possible without waiting on DOMContentLoaded event
- improved INP metric - wrapping consent handler in `setTimeout(fn, 0)`
- updated CHANGELOG
- updated README
- renamed the package name to `@68publishers/cookie-consent`
- updated CDN url in the GTM template
- updated CHANGELOG
@tg666
Copy link
Contributor Author

tg666 commented Aug 30, 2024

💡 Also merge #83 with the new release

@tg666 tg666 requested a review from jelen07 August 30, 2024 04:15
@tg666 tg666 merged commit 0ea20ea into main Sep 19, 2024
@tg666 tg666 deleted the feature/performance-improvements branch September 19, 2024 12:03
@bennetsadyba
Copy link

How did you manage to improve INP? Did you setTimeout on some function call?

@tg666
Copy link
Contributor Author

tg666 commented Oct 14, 2024

@bennetsadyba Basically, yes. I wrapped in setTimeout() actions that are executed when the consent is given.
In particular, this delays communication with GTM until the next frame, so the cookie bar can hide immediately - faster response.

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

Successfully merging this pull request may close these issues.

2 participants