Table of contents
Third-party scripts — chat, ad pixels, Google Tag Manager, maps, embedded video, fonts from external servers — are today the most common cause of poor Core Web Vitals on business websites, more so than hosting or the theme. Each one adds anywhere from a few dozen to several hundred kilobytes and 50 to 500 ms of blocking time. The fix takes three steps: measure what you have; remove what you don’t use; delay the rest until user interaction.
Thesis: a site's performance budget is spent by people who have never seen it
Marketing adds a Meta pixel. Sales adds a chat. Someone hooks up a Google map and Tag Manager "for the future," and over time it collects 14 tags, 5 of which belong to campaigns that ended two years ago. Each of those steps made sense. The sum is a site with an INP of 600 ms and an LCP of 4 s on mobile — and an owner who suspects the hosting.
Nobody measures this because nobody owns the performance budget. This article is here so that you become that owner.
What each script costs — approximate figures
| Script | Transfer | Blocking time (mobile) | Notes |
|---|---|---|---|
| Google Tag Manager (container only) | 80–120 kB | 100–200 ms | Plus everything inside it |
| Google Analytics 4 | 60–90 kB | 50–100 ms | Via GTM or directly |
| Meta pixel | 100–150 kB | 100–250 ms | One of the heavier ones |
| Chat (typical widget) | 300–800 kB | 200–600 ms | The heaviest element on most sites |
| Google Map (embedded) | 400–700 kB | 200–400 ms | Loads even when the map is at the bottom of the page |
| YouTube (iframe) | 500–800 kB | 200–500 ms | Fix: a facade — covered in our article on video on your website |
| Fonts from an external server | 50–200 kB | 100–300 ms + FOIT/FOUT | Plus GDPR |
| Reviews script / social widget | 100–300 kB | 100–300 ms | Often loaded globally |
| Hotjar / Clarity | 100–200 kB | 50–150 ms | Worth having — but not permanently on every subpage |
Approximate values from measurements on typical business websites. Total on a page with chat, a pixel, GTM, a map and fonts: 1–2 MB of scripts before the user sees anything — more than the rest of the page combined.
Step 1. Measure — 15 minutes
- PageSpeed Insights → the “Reduce the impact of third-party code” section — a list of scripts with their main-thread blocking time.
- The Network tab in your browser (F12) → “JS” filter → sort by size → look for domains other than yours.
- Tag Manager → tag list → for each one: when did anyone last look at the data it collects?
Result: a list of scripts with three columns — size, time, what it’s for. The third column is the most important and most often empty.
Step 2. Remove — the "who's looking at this?" rule
A script stays if someone at your company regularly looks at the data it collects or uses the feature it provides. Everything else goes. Typical finds:
- advertising pixels from completed campaigns,
- two analytics systems (GA4 and the "old" Universal, which hasn't worked since 2023),
- a chat that nobody answers after 5:00 PM — while customers write at 8:00 PM,
- a reviews widget loaded on a page that already has reviews in its content,
- a Google map in the footer of every subpage,
- "test" GTM tags from a year ago.
From our audits: half the tags in a typical GTM container are dead. Removing them costs nothing and breaks nothing.
Step 3. Delay the rest
A script that stays doesn't have to load right away. Three techniques, starting with the simplest:
| Technique | What it does | Purpose |
|---|---|---|
| Delay until interaction (optimization plugins have a “delay JS” option) | The script loads after the first scroll/click or after X seconds | Chat, pixels, social widgets, Hotjar |
| Facade | A static image instead of the embed; the real element loads on click | Map, video, chat (icon instead of widget) |
| Conditional loading | Load scripts only on the subpages where they're needed | Map: only on the contact page; store script: only in the store |
The pixel trap: delaying an ad pixel until interaction means a user who landed and left without doing anything won’t be counted. That’s usually acceptable (they weren’t going to buy anyway), but agree on it with whoever runs your campaigns — and remember that with Consent Mode the pixel doesn’t fire before consent anyway; more context in our article on the cookie banner.
Chat — a chapter of its own
Chat is the heaviest element on most websites, and also the one businesses refuse to give up. Three options instead of "remove it":
- Facade icon: a static button in the corner; the widget loads on click. Cost: 2 kB instead of 600.
- Loading after 5–8 seconds or on scroll — a user who leaves after 3 seconds didn’t need the chat.
- Chat only on service pages and the contact page, not on the blog.
If the chat has an AI assistant, remember to label it in line with the AI Act, regardless of how it loads.
Tag Manager — a cleanup once a quarter
GTM itself isn't the problem; a container with no owner is. The rules:
- every tag has a description: who, why, until when,
- campaign tags have an expiry date in their name,
- container review once a quarter — removing, not just adding,
- “all pages” triggers only for analytics; everything else conditional.
Fonts and maps — two quick wins
Fonts from external servers mean extra transfer, delayed text rendering and a GDPR problem — we devote a separate article in this series to them; in short: host them locally, load 2–3 variants, font-display: swap.
Google Map: a static map image (WebP, 30 kB) linking to Google Maps. An interactive map only on the contact page, after clicking “show map”. Users navigate in the app anyway, not in an embedded frame.
How much you can recover — a model
A typical business website before: chat (600 kB), GTM with 10 tags (400 kB), map in the footer (500 kB), external fonts (150 kB), YouTube (700 kB). Total: ~2.3 MB of scripts and embeds.
After: chat as a facade (2 kB), GTM with 4 delayed tags (200 kB after interaction), static map (30 kB), local fonts (60 kB), YouTube facade (25 kB). Total: ~120 kB on first load.
The effect on Core Web Vitals: LCP typically drops from 3–4 s to under 2.5 s, INP from 400–600 ms to under 200 ms — without changing hosting or the theme and without removing features the business uses. For the full optimization picture, see our article on how to speed up WordPress.
From our experience
The most common single fix in performance audits: replacing the chat widget with an icon facade. No one at the company notices a difference in how it works; PageSpeed notices right away.
A third-party script audit is part of our SEO and UX audit, and we handle GTM cleanup, facades and delayed loading as part of website maintenance.
FAQ — third-party scripts
The container itself adds little; what slows things down is what's inside it. A container with 10–15 tags loaded on every page can add several hundred milliseconds of blocking time. The fix: remove dead tags, use conditional triggers, and delay loading until user interaction.
Delaying until interaction skips users who landed and left without any movement. For session analytics that's usually acceptable; for advertising pixels, check with whoever runs your campaigns. Google Analytics can load normally, and only the heavier widgets need to be delayed.
In PageSpeed Insights, the "Reduce the impact of third-party code" section shows a list of external scripts with their blocking time. The Network tab in your browser's developer tools shows sizes and domains. The total of scripts from domains other than your own is your cost.
Author: Adrian Kamiński — Websky Studio, Poznań. WordPress performance optimization — we start with external scripts, because that's where there's the most to gain.
Your feedback
Was this article helpful?
One click — it helps me choose future topics.

