🔎 Focus: Site Speed
🔴 Impact: High
🟠 Difficulty: High-Medium

1. Third-party scripts have changed

For a long time, third-party scripts didn’t feel like a real problem.

Analytics, tag managers, chat widgets, A/B testing tools - they all slowed things down a bit, but:

  • Pages still loaded

  • Users still converted

  • Lighthouse scores were “acceptable”

So, performance optimization often stopped at image compression and a CDN. As long as nothing was obviously broken, it was good enough.

Your website was fast enough.

But modern websites don’t load one or two scripts anymore. They load dozens. And almost all of them compete for the most critical resource in the browser: the main thread.

At that point, “fast enough” starts becoming slow.

Sites trying to respond to user interaction in 2025

2. Third-party scripts are a large performance bottleneck

A lot of performance issues today come from:

  • Tag managers

  • Advertising pixels

  • Analytics platforms

  • Customer support widgets

  • Heatmaps and session recording tools

All of these scripts:

  • Block rendering

  • Delay interactivity

  • Execute on the main thread

  • Increase Total Blocking Time (TBT)

In practice, it’s not network speed that hurts you - it’s Javascript execution.

🧑‍💻 Technical Note: The browser can download many files in parallel, but it can only execute JavaScript on the main thread, one task at a time.

This means every third-party script:

  • Competes with rendering

  • Competes with user interactions

  • Competes with your own application logic

The result:

  • Slower First Contentful Paint

  • Higher Interaction to Next Paint

  • Worse Core Web Vitals

In the case below third-party scripts block the thread for over 6 seconds which is a long time.

Third-party scripts go bonkers

Worried about your site speed?

Start with our initial technical analysis of your site

3. Why “async” and “defer” are not enough

Most third-party scripts already use async or defer.

And yet… performance is still bad.

Why?

Because async and defer only change when scripts execute - not where.

They still:

  • Run on the main thread

  • Block other Javascript

  • Trigger layout and style recalculations

🧑‍💻 Reality check:
Even a deferred script can cause long tasks and jank if it’s heavy enough.

This is the ceiling of traditional script optimization.

4. Partytown: Move third-party scripts off the main thread

Partytown changes the execution model entirely.

Instead of running third-party scripts on the main thread, it runs them inside a Web Worker.

What does that give you:

  • Main thread stays free

  • Rendering happens earlier

  • User interactions are smoother

  • Third-party long tasks disappear

In short:
Your page loads while third-party scripts run in the background.

🧑‍💻 How it works (simplified):
Partytown proxies browser APIs so third-party scripts believe they are running normally, while actually executing off the main thread.

This makes it ideal for:

  • Google Analytics

  • Google Tag Manager

  • Marketing & advertising pixels

  • Experimentation tools

Scripts still work → They just stop blocking everything else.

Source: Qwik PartyTown Documentation

5. What kind of speed gains to expect

Moving third-party scripts to Partytown typically results in:

  • Lower Total Blocking Time

  • Smoother scrolling and interactions

  • More stable Core Web Vitals

The biggest gains happen on:

  • Content-heavy pages

  • Marketing pages

  • Mobile devices

  • Low-powered CPUs

🧑‍💻 Important:
Partytown doesn’t make scripts faster.
It makes them less disruptive.

That’s often the difference between a page feeling sluggish and feeling instant.

6. How to use Partytown safely

Partytown is powerful, but it’s not universal.

Best practices for using Partytown:

1. Use it only for third-party scripts
Never move critical rendering or business logic.

2. Start with analytics and marketing tools
These scripts are the most expensive and least critical for rendering.

3. Test events and tracking carefully
Some third-party tools rely on synchronous execution, and moving them to a web worker disrupts the event handling.

4. Monitor performance before and after
Track TBT, INP, and long tasks.

🧑‍💻 Rule of thumb:
If the page can render without a third-party script, it probably belongs in Partytown.

7. Turning performance theory into a Partytown setup

At this point, the goal should be clear:
protect the main thread and let content render first.

Partytown is not a generic performance tool - it solves a very specific problem:
third-party scripts stealing time from rendering and interactivity.

The table below maps common performance problems directly to how Partytown addresses them.

Final takeaway

Many modern websites aren’t slow only because of images or servers.
They’re slow because too much JavaScript fights for the main thread.

Partytown doesn’t remove third-party scripts - it puts them in their place.

If you care about site speed, smooth interactions, and real-world performance, optimizing third-party scripts is no longer optional.

And Partytown is one of the cleanest ways to do it.

Book a Technical-First SEO Analysis below

Until next time 👋

Patryk

oh that’s a human