Partytown
Partytown is an open source library by Builder.io that runs third party scripts (analytics, ad pixels, tag managers) inside a web worker so they no longer block the main thread. It improves Core Web Vitals dramatically but does not change the GDPR position of the scripts it wraps. Consent obligations under ePrivacy and the GDPR remain attached to the underlying scripts. Treat Partytown as a performance optimisation, not a privacy tool.
What does Partytown do?
What is Partytown?
Partytown is an open source library maintained by Builder.io. It moves third party scripts (Google Analytics, Google Tag Manager, Meta Pixel, TikTok Pixel, Hotjar, etc.) from the main JavaScript thread into a web worker, sharply reducing their impact on Core Web Vitals. Developers integrate Partytown into Next.js, Astro, Nuxt, Hugo and many other frameworks.
Common misconception: Partytown is not a privacy tool
Partytown is sometimes presented as a way to make analytics or ad pixels GDPR compliant. This is incorrect. Partytown only changes the JavaScript execution context. The wrapped scripts still set cookies, still read browser identifiers and still send the same payloads to their respective vendors. Consent obligations remain attached to those scripts.
GDPR and ePrivacy implications
Article 5(3) of the ePrivacy Directive applies to any access to information stored on the user's device. A script running in a web worker still triggers cookie reads and writes, so consent is required. The GDPR lawful basis for the wrapped scripts is also unchanged: Partytown does not transform GA4 from a consent based tracker into a legitimate interest tracker.
Integration with a Consent Management Platform
Configure your CMP to gate the loading of Partytown wrapped scripts in the same way you would gate them when loaded directly. Partytown supports lazy script injection so that GA4 or the Meta Pixel only loads after the user grants the relevant consent category. Use the partytown reverseProxy or forward configuration to keep first party hosting where possible.
Practical compliance steps
Self host Partytown on your own origin to avoid extra third party connections, gate the wrapped scripts behind your CMP, document Partytown as a performance technique in your privacy policy without claiming compliance benefits, and apply the same DPIA, retention and transfer analysis to the wrapped scripts as you would for direct deployment.
Partytown and the GDPR
Partytown is classified as “Unclassified”. On a site that targets European visitors, it must only load after the visitor consents, and it must be listed in your cookie policy.
- Legal basis
- Partytown inherits the legal basis of the scripts it executes. Consent (Art. 6(1)(a) GDPR and Art. 5(3) ePrivacy Directive) is required when wrapping advertising, analytics or any non strictly necessary tracker. Partytown does not change the consent obligation, it changes only where the script runs.
- Risk level
- medium
- Applicable regulations
- GDPR, ePrivacy Directive, regional consent laws applicable to the wrapped scripts
Impact assessment (DPIA)
Partytown itself adds no DPIA trigger because it processes no data. The DPIA obligation is determined by the underlying tracking scripts. If Partytown is used to wrap GA4, Meta Pixel or other high risk advertising tags, those individual services drive the DPIA assessment.
Sample text for your banner
This site uses Partytown to run third party analytics and advertising scripts in a web worker for performance reasons. The underlying scripts (named below) still process your browser data and require your consent. Partytown only changes where these scripts run, not what they collect.
What Partytown sets and contacts
- Tracking method
- Open source library by Builder.io that relocates third party scripts (analytics, ad pixels, tag managers) into a web worker so they run off the main thread. Partytown itself does not collect data, it sandboxes other vendors. Cookie and tracking behaviour is fully determined by the wrapped scripts.
- Server location
- No server side processing. Partytown is loaded as static assets, ideally self hosted on the website's own origin or its CDN. The maintainer Builder.io is a US company.
- Cookieless mode available
- Yes
- Data transferred outside the EU
- Partytown itself does not transfer data, but the scripts it wraps (Google Analytics, Meta Pixel, GTM, etc.) typically transfer data to the United States. The transfer compliance position is identical to running those scripts directly.
Cookies set (1)
| Name | Type | Duration | Purpose |
|---|---|---|---|
| No cookies | none | n/a | Partytown is a JavaScript library that relocates third party scripts to a web worker. It does not set its own cookies. Cookies set by the relocated third party scripts (analytics, ads, chat) keep their original behaviour and are subject to the same consent rules as if they ran on the main thread. |
Third-party domains contacted (3)
cdn.jsdelivr.netunpkg.compartytown.builder.io
Frequently asked questions about Partytown
Can't find your question? Write to us, we answer fast.
Does Partytown set its own cookies?
No. Partytown is a JavaScript runtime helper. It does not collect data, does not contact a server and does not set cookies of its own. Any cookies you observe come from the third party scripts you wrap (GA4, Meta Pixel, GTM, etc.).
Is consent required when using Partytown?
Yes when the wrapped scripts require it. Partytown does not change the consent obligation, only the execution context. If you wrap GA4, Meta Pixel or any advertising tracker, Article 5(3) ePrivacy still requires prior consent.
What is the legal basis for Partytown itself?
Partytown is a static client side library, so it does not require its own legal basis under GDPR. The lawful basis question applies to the scripts it wraps, not to Partytown.
Does Partytown affect international data transfers?
No. Partytown changes only the JavaScript thread. The wrapped scripts continue to send the same payloads to the same vendors in the same locations. If GA4 transfers to the United States, that does not change because Partytown wraps it.
Do I need a DPIA for Partytown?
Not for Partytown itself. The DPIA depends entirely on the wrapped scripts. If you wrap a high risk advertising tracker, run a DPIA on that tracker.
How do I implement Partytown compliantly?
Self host the Partytown library on your own origin, gate the wrapped scripts behind a CMP, document Partytown as a performance optimisation in your privacy policy, and ensure your CMP loads the actual tracking scripts only after consent.
Is Partytown an alternative to consent management?
No. It is complementary. Partytown improves Core Web Vitals; a CMP handles consent. You typically deploy both: the CMP gates whether scripts load, Partytown decides where they execute.
How do I update my cookie policy for Partytown?
Mention Partytown briefly as a web worker library used for performance and clarify that it does not collect data. List the actual third party scripts (GA4, Meta Pixel, GTM, etc.) wrapped through Partytown with their cookies, retention and transfers.
TypeScript
TypeScript is a JavaScript library that simplifies web development by providing utility functions, DOM manipulation tools, and cross-browser compatibility. It offers a clean, chainable API that reduces code complexity and development time. TypeScript supports AJAX requests, event handling, and animation effects. With extensive documentation and a vast plugin ecosystem, TypeScript remains a reliable choice for developers building interactive, performant web experiences.
Tiptap
Tiptap is a foundational web service that powers critical website functions and digital experiences. It provides reliable infrastructure, seamless integration capabilities, and consistent performance across all devices and browsers. Tiptap supports modern development practices and scales with growing business needs. With a focus on stability and compatibility, Tiptap ensures your website delivers a smooth, uninterrupted experience to every visitor and search engine crawler.
Kendo UI
Kendo UI is a foundational web service that powers critical website functions and digital experiences. It provides reliable infrastructure, seamless integration capabilities, and consistent performance across all devices and browsers. Kendo UI supports modern development practices and scales with growing business needs. With a focus on stability and compatibility, Kendo UI ensures your website delivers a smooth, uninterrupted experience to every visitor and search engine crawler.
iCheck
iCheck is a web technology service that provides essential functionality for websites and digital platforms. It delivers core capabilities that support site operations, content delivery, and user experience optimization. iCheck integrates seamlessly with modern web architectures, ensuring reliable performance and compatibility across browsers and devices. Trusted by businesses worldwide, iCheck helps organizations maintain robust websites that meet user expectations and technical requirements.
visx
Visx is a foundational web service that powers critical website functions and digital experiences. It provides reliable infrastructure, seamless integration capabilities, and consistent performance across all devices and browsers. Visx supports modern development practices and scales with growing business needs. With a focus on stability and compatibility, Visx ensures your website delivers a smooth, uninterrupted experience to every visitor and search engine crawler.
CFML
CFML is a foundational web service that powers critical website functions and digital experiences. It provides reliable infrastructure, seamless integration capabilities, and consistent performance across all devices and browsers. CFML supports modern development practices and scales with growing business needs. With a focus on stability and compatibility, CFML ensures your website delivers a smooth, uninterrupted experience to every visitor and search engine crawler.
Make your site compliant today.
Free up to 25,000 sessions a month. No credit card, no commitment.