How to integrate Partytown in custom code of builder.io?

Builder content link

What are you trying to accomplish
I have several analytics scripts added on my landing page in builder
I want to wrap these scripts in Partytown to improve page speed.
How can I achieve this?

I tried to use method for third party libraries.
Screenshots or video link

Hi @Artemis, welcome to the forum! Since Partytown is using a service worker, the static lib files must be served from the same origin as your site, and cannot be hosted from a CDN. So unfortunately the method you tried won’t work. Alternatively, you can check out the Partytown docs below to see how to integrate it into your site.

Partytown: Getting Started

Hi, I didn’t find the guide in docs how to integrate Partytown to builder.io dashboard. Could you help me please ?

Hi @Artemis, at this time you cannot enable Partytown through the Builder.io dashboard. Can you please provide more details about your tech stack?

Hi, we use react + next.js

Thanks for sharing those details. Here is our guide to adding Partytown in Next.js. Let us know if you have additional questions!

https://partytown.builder.io/nextjs