🔍 inp.works

Third-party scripts blocking interactions: diagnosing and containing them

What is happening

Third-party scripts — analytics, tag managers, ads, chat widgets, A/B testing — run on the same main thread as your code. When a tag manager evaluates fifty rules or an ad script parses a payload, your user's click waits exactly like it would for your own long task.

The Long Animation Frames API attributes long tasks to their source URL, so you can see exactly which domain is costing you INP.

How to recognise it

How to fix it

Problem

<script src="https://cdn.example-widget.com/loader.js"></script>
<!-- synchronous: blocks parsing AND competes for the main thread -->

Fix

<script async src="https://cdn.example-widget.com/loader.js"></script>
<!-- or better: inject on first user intent -->
<script>
  chatButton.addEventListener("click", loadChatWidget, { once: true })
</script>
Scan your site for free →
Advertise here