Technical SEOIntermediate

Third-party scripts

Third-party scripts are JavaScript loaded from other companies' servers, like chat, analytics and ad tags. They often slow pages more than a site's own code.

Also called: Third-party JavaScript, Third-party tags

Third-party scripts are pieces of JavaScript that a site loads from an outside provider, such as analytics, tag managers, chat widgets, A/B testing tools, session recorders, ad pixels and video embeds. Each adds network requests and main-thread work that the site owner does not fully control. On many SaaS marketing sites they make up a large share of the JavaScript, and they are a frequent cause of poor Interaction to Next Paint and Total Blocking Time.

How they affect performance

Third-party code competes for the same main thread as your own. Synchronous tags in the head block rendering. Scripts that load further scripts create long request chains. Some run work on every interaction, such as session recorders listening to every click and scroll, which can hurt INP.

Auditing them

Lighthouse has an audit that shows the main-thread time spent by each third-party provider. The Chrome performance panel shows which scripts produce long tasks. List every tag, who owns it, what it is used for, and whether it is still needed. Old pixels from past campaigns are common.

  • Remove tags nobody uses
  • Load non-essential tags after the page is interactive or on user action
  • Replace heavy embeds with lightweight facades that load on click
  • Use async or defer for tags that must load early
  • Self-host scripts where licensing and updates allow

Facades

A facade is a static placeholder that looks like the widget, such as a chat bubble or a video thumbnail, and loads the real script only when someone interacts with it. Chat widgets and video embeds are the usual candidates.

Example

Fifteen tags in the tag manager

An audit of Tidewell's tag manager finds fifteen tags, four of them for ad campaigns that ended long ago and two duplicate analytics tags. Removing the dead tags, delaying the session recorder until after the first interaction and swapping the chat widget for a facade reduces main-thread work on the homepage in lab tests.

Common mistakes

Letting anyone add tags

Tag managers make adding scripts easy and removing them rare. Assign an owner and review tags on a schedule.

Blocking rendering to avoid A/B test flicker

Anti-flicker snippets hide the page until the test script loads. Weigh that delay against the test's value.

Questions

Google renders pages with JavaScript, so scripts that change content can affect what is indexed. Most third-party tags do not change content, but their cost shows up in user experience metrics.

Know the terms. Now win the searches.

We find the searches your buyers make, then build, publish and improve the pages that win them.