Performant Cookie Consent Banner Example

Read all about this approach on Lessons of a CTO. The heavily-commented code powering this is available open-source on GitHub.

For the purpose of the demo, I've added US/Canada/Australia/New Zealand to the list EU+UK countries requiring consent. If you're outside of these, you'll need to use a VPN or test with something like WebPageTest.

These buttons would typically live on a cookie policy / privacy page, tucked out of the way.

They will typically see infrequent use even on high-traffic sites, hence why the implementation is optimised for maintainability over user experience.

We use cookies, do you want cookies too?

What cookies do you want?