Skip to content
Learn Measure Blog Case studies About
Join and donate to 🇺🇦 DevFest for Ukraine, a charitable tech conference happening June 14–15 supported by Google Developers and Google Cloud.
On this page
  • How the Lighthouse audit for third-party code fails
  • How to reduce the impact of third-party code
  • Resources

Reduce the impact of third-party code

May 2, 2019 — Updated Oct 4, 2019
Appears in: Performance audits
On this page
  • How the Lighthouse audit for third-party code fails
  • How to reduce the impact of third-party code
  • Resources

To add an advertising network, social media button, A/B test, or analytics service to your page, you usually need to add a third-party script to your HTML. These third-party scripts can significantly affect your page load performance.

How the Lighthouse audit for third-party code fails #

Lighthouse flags pages that have third-party code that blocks the main thread for 250 ms or longer:

A screenshot of the Lighthouse Reduce the impact of third-party code audit

A third-party script is any script hosted on a domain that's different than the domain of the URL that you audited with Lighthouse. As the page loads, Lighthouse calculates how long each of the third-party scripts blocks the main thread. If the total blocking time is greater than 250 ms the audit fails.

How to reduce the impact of third-party code #

See Identify slow third-party scripts to learn how to use Chrome DevTools and other Lighthouse audits to detect problematic third-party code, and see Efficiently load third-party JavaScript for optimization strategies.

Resources #

  • Source code for Reduce the impact of third-party code audit
  • Loading Third-party JavaScript
Last updated: Oct 4, 2019 — Improve article
Return to all articles
Share
subscribe

Contribute

  • File a bug
  • View source

Related content

  • developer.chrome.com
  • Chrome updates
  • Web Fundamentals
  • Case studies
  • Podcasts
  • Shows

Connect

  • Twitter
  • YouTube
  • Google Developers
  • Chrome
  • Firebase
  • Google Cloud Platform
  • All products
  • Terms & Privacy
  • Community Guidelines

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies.