A local service site usually looks lean on the surface: a hero photo, a phone number, a quote form, a few service pages. Then you open the network waterfall and find a tag manager, two analytics tools, an ad pixel, a call-tracking script, a chat bubble, a review carousel, an embedded map, a booking widget, and font files pulled from someone else's CDN. On many small-business sites, most of the requests and a large share of main-thread time belong to code the owner never wrote and nobody has reviewed in a year.
This guide is a working method for taming that code. You will learn how third-party scripts damage Core Web Vitals, where TTFB really fits in, how to audit the cost of each tag with DevTools, WebPageTest, and Lighthouse, which fixes pay off most for plumbers, HVAC companies, dentists, and similar service sites, and how to prove the improvement with real-user data rather than a single lucky lab score.
A third-party script is any JavaScript, CSS, font, iframe, or image served from a domain you do not control. The problem is not that these resources exist. It is that they compete with your own content for the same scarce resources: network connections, bandwidth, and above all the browser's single main thread. Each Core Web Vital suffers through a different mechanism.
- LCP (Largest Contentful Paint, good is 2.5 seconds or less). Synchronous scripts in the head block parsing. Every new origin needs its own DNS lookup, TCP connection, and TLS handshake before a single byte arrives. A/B testing tools that hide the page with an anti-flicker snippet delay first paint by design. Heavy tags also steal bandwidth from your hero image during the exact seconds it needs to download.
- INP (Interaction to Next Paint, good is 200 milliseconds or less). Long tasks from tag managers, chat widgets, and session-replay tools occupy the main thread. If a visitor taps your Call Now button while a vendor script is mid-task, the response waits.
- CLS (Cumulative Layout Shift, good is 0.1 or less). Chat bubbles, cookie banners, review widgets, and embedded booking forms that inject themselves without reserved space push content around. Web fonts that swap in late with different metrics do the same.
Lab tools summarize main-thread damage as Total Blocking Time (TBT). TBT is not a Core Web Vital, but it is a decent lab proxy for INP risk, which is why Lighthouse leans on it when it ranks third-party offenders.
There is also a control problem: a vendor can change its code overnight and your performance shifts with no deploy on your side.
Time to First Byte measures how long your server takes to start answering the HTML request. A chat widget loaded by client-side JavaScript cannot change that number, so be skeptical of any advice that claims a tag slowed your TTFB directly. The honest picture has three parts.
- Server-side third-party calls do inflate TTFB. Some WordPress plugins and themes call a remote API during page generation: fetching reviews from a vendor, checking a license, pulling a social feed. If that remote service is slow and the response is not cached, your HTML waits for it. This is the one place where a third party genuinely lands in TTFB.
- Redirects through tracking domains add delay before the first byte. Ad click links and call-tracking or link-shortener hops each add a round trip before your page even starts. Audit the landing URLs in your ad campaigns for redirect chains.
- Everything after TTFB is where tags do their damage. A fast TTFB gives you a head start, and render-blocking third-party resources spend it. A site with a 300 millisecond TTFB and three blocking vendor scripts can still post a poor LCP.
To separate the cases, compare TTFB on a cached versus uncached request and check whether your server sends Server-Timing headers or has a profiler available. If TTFB is slow only on uncached requests, look for remote calls during rendering. If TTFB is fine but LCP is poor, look at what loads between the HTML arriving and the hero rendering.
You cannot prune what you cannot see. Start with a plain spreadsheet that lists every third-party resource on your highest-value pages: the homepage, your top service pages, and your top city or location pages. For each entry, record the vendor, the purpose, who requested it, where it is loaded (theme settings, plugin, hardcoded, or tag manager), and when someone last used its data.
A typical local-service site inventory includes:
- Analytics (GA4, sometimes a second tool left over from a previous agency)
- Ad and social pixels (Google Ads, Meta, sometimes TikTok or Bing)
- Call tracking with dynamic number insertion
- Live chat or an AI chat bubble
- Reviews carousel, often a Google Business Profile reviews widget
- Embedded Google Map and YouTube videos
- Booking or scheduling widget
- Form spam protection such as reCAPTCHA
- Heatmap or session-replay tool
- Web fonts from a vendor CDN
Then ask one blunt question per row: if this disappeared tomorrow, who would notice, and what decision would they no longer be able to make? Tags with no answer are candidates for immediate removal. The first pass often turns up duplicate analytics, pixels for abandoned ad platforms, and forgotten heatmap trials. Removing a tag is the only fix with zero ongoing cost, so do it first.
Use all three tools, because each shows something the others miss. Test on a throttled mobile profile, since that is where local searchers are and where main-thread problems are most visible.
Chrome DevTools. In the Network panel, tick the option to show only third-party requests, then sort by size and time to see the heaviest offenders. To measure one vendor's impact, right-click a request and block that domain, then reload and compare. In the Performance panel, record a page load with 4x CPU slowdown and a mobile network preset, then group the Bottom-Up view by domain to see how much main-thread time each vendor consumed.
Lighthouse. Run it through PageSpeed Insights or DevTools and read the audit titled "Reduce the impact of third-party code." It breaks down transfer size and main-thread blocking time per vendor. A related audit flags third-party resources, such as embedded videos and chat widgets, that have a lightweight facade alternative. Lighthouse scores vary between runs, so run it several times and use the median.
WebPageTest. This is the best tool for before-and-after proof. Run a mobile profile from a location near your customers, with at least three repeats. Use the waterfall and the request map to see which domains pull in other domains (a tag that loads a tag that loads a tag), and the filmstrip to see what the visitor sees over time. Its blocking feature lets you run the same test with specific domains blocked, giving you a direct with-and-without comparison. Its single-point-of-failure test shows whether a dead vendor server could stall your whole page.
The output of this phase is a ranked list: vendor, bytes, blocking time, and what it contributes to the business. That list drives every decision that follows. If you want a quick benchmark before building it, our website SEO audit flags heavy scripts and slow pages across your key URLs.
Once unneeded tags are gone, change how the remaining ones load. The default for any third-party script should be never blocking the first render.
Know the difference between async and defer. Both download without blocking the parser. An async script executes the moment it finishes downloading, in no guaranteed order, and can interrupt parsing. A deferred script executes after the document is parsed, in order. Analytics and pixels rarely depend on execution order, so async is fine. Scripts that depend on each other should be deferred.
Go later than defer when the script is not needed for first paint. A chat bubble does not need to run during page load. You can load it after the load event, when the browser is idle, or on first interaction:
function loadVendor() {
if (window.__vendorLoaded) return;
window.__vendorLoaded = true;
var s = document.createElement('script');
s.src = 'https://vendor.example/widget.js';
s.async = true;
document.body.appendChild(s);
}
['pointerdown','keydown','scroll'].forEach(function (e) {
addEventListener(e, loadVendor, { once: true, passive: true });
});
setTimeout(loadVendor, 6000); // fallback for passive visitors
Use connection hints sparingly. Preconnect only to the two or three origins you need early, and use dns-prefetch for the rest. Keep your hero image discoverable in the HTML so vendor traffic does not outrank it.
Tune the tag manager. In Google Tag Manager, a trigger on Page View fires as early as possible, DOM Ready fires later, and Window Loaded later still. Move non-essential marketing tags to later triggers. Be careful with conversion tracking: delaying it too far can lose conversions from visitors who tap a phone link and leave quickly. After any change, place a test call and submit a test form to confirm events still arrive.
A facade is a lightweight stand-in that looks like the real widget but loads none of its code until the visitor asks for it. It is the highest-leverage fix for the heavy embeds common on service sites.
- Chat widgets. Render a static button styled like the chat bubble. On click, hover, or first interaction, load the real widget and open it immediately. Test that the first click really opens the chat, since a button that does nothing for three seconds loses leads.
- YouTube and video. Show a thumbnail with a play button and swap in the iframe on click. Lightweight embed components exist for exactly this, and the privacy-enhanced embed domain reduces cookie weight.
- Maps. Use a static map image or a click-to-load placeholder, and mark any iframe that must exist with lazy loading.
- Reviews widgets. Instead of a client-side script that fetches and injects reviews, render them into the page HTML and refresh them on a schedule. Reserve the container's height so late content cannot shift the layout.
- Booking widgets. Link to a dedicated booking page and load the embed only there, instead of loading it on every URL.
Self-host your fonts. Fonts requested from a vendor domain cost an extra connection, and modern browsers partition caches by site, so the old argument that visitors already have the font cached from another site no longer holds. Download the font files, serve them as WOFF2 from your own domain, subset them to the characters you need, and limit yourself to the weights actually used. Then control the swap behavior to protect CLS:
@font-face {
font-family: 'BodyFont';
src: url('/fonts/bodyfont-var.woff2') format('woff2');
font-weight: 400 700;
font-display: swap;
}
@font-face {
font-family: 'BodyFallback';
src: local('Arial');
size-adjust: 104%;
ascent-override: 92%;
}
body { font-family: 'BodyFont', 'BodyFallback', sans-serif; }
Preload the one or two font files used above the fold, with the crossorigin attribute, and tune the fallback metrics so the swap barely moves text. Treat the adjustment values above as placeholders.
A tag manager makes it easy to add tags, and that ease is the problem. Containers accumulate paused tags, abandoned experiments, and custom HTML snippets from past agencies. Every extra tag adds JavaScript to parse and execute, and a bloated container ships its entire weight to every visitor.
- Audit quarterly. Review each tag against the inventory. Delete paused and duplicate tags rather than leaving them disabled, and keep the version history as your safety net.
- Scope triggers tightly. A pixel for the roofing service page does not need to fire on the blog. Fire tags only where their data is used.
- Prefer built-in tag templates over custom HTML. Custom HTML runs arbitrary code that nobody reviews, and it is the most common source of surprise slowdowns and security issues.
- Keep one container per site. Multiple containers duplicate overhead and make ownership unclear.
Partytown, conceptually. Partytown is an open-source library from Builder.io that moves third-party scripts off the main thread and into a web worker. You mark a script with a special type, and Partytown runs it in the worker, proxying the DOM access it needs back to the main thread. The main thread stays free for your own interactions, which helps INP, but the trade-offs are real. Some scripts break or misbehave when they cannot touch the page synchronously, cross-origin requests may need a proxy to work around CORS limits, and debugging is harder. For most local businesses running on WordPress, Wix, or Squarespace, it is not a practical option, and removal plus delayed loading gets you most of the benefit. It is more relevant when your team controls a custom front end built on a framework with an integration.
A lab score from one run is a smoke test, not proof. Google evaluates Core Web Vitals using real-user field data at the 75th percentile, so your measurement plan should reflect that.
- Capture a baseline first. Record the field data section in PageSpeed Insights for your key URLs, the Core Web Vitals report in Search Console, and a median of at least three WebPageTest runs on a fixed mobile profile. Save screenshots and numbers with the date.
- Change one thing at a time where possible. If you remove four tags and add a facade in a single release, you will not know which fix mattered. Roll out in batches and re-test after each.
- Add real-user monitoring. The open-source web-vitals library reports LCP, INP, and CLS from actual visitors to your analytics. Its attribution build, together with the Long Animation Frames API in Chromium browsers, can show which script caused a slow interaction.
- Be patient. Public field reports use a rolling 28-day window, so gains appear gradually.
Set guardrails so the gains stick: a simple budget for third-party requests and blocking time on key templates, a rule that every new tag needs an owner and a test, and a re-audit after major plugin or theme updates.
Keep expectations honest: page experience is one signal among many, and the more dependable payoff is behavioral, since a page that responds when a visitor taps Call Now converts better than one that stalls. For more technical guides, browse the RankLocalToday blog.
Do third-party scripts affect Google rankings?
Indirectly. Core Web Vitals are part of Google's page experience signals, and heavy third-party code is a common cause of poor LCP, INP, and CLS. Those signals are lightweight compared with relevance and content quality, so treat script cleanup as a tiebreaker and a conversion improvement, not a shortcut to rankings.
Should I remove Google Tag Manager entirely?
Not necessarily. Tag Manager is a reasonable container when it is kept clean. The performance problem is usually what is inside it: duplicate, paused, or custom HTML tags firing on every page. Audit the container, scope triggers, and delete unused tags first. Remove it only if you run so few tags that hardcoding them is simpler.
Will lazy-loading my chat widget hurt lead capture?
It can if done carelessly. A facade that loads the real widget on first interaction or after a short delay usually keeps most of the benefit, as long as the first click opens chat promptly. Test it on mobile, check whether proactive greetings are still needed, and compare chat starts before and after the change.
Is self-hosting Google Fonts actually faster?
Usually yes. Self-hosting removes an extra connection to a third-party domain, lets you preload critical files, and gives you control over subsetting and caching. Browsers now partition caches per site, so the old shared-cache advantage no longer applies. Pair it with font-display and a metric-matched fallback to protect layout stability.
How do I know which script is slowing my site most?
Start with the Lighthouse audit that lists third-party code by blocking time and transfer size, then confirm in DevTools by blocking one domain at a time and reloading. WebPageTest's domain breakdown and blocking feature give a repeatable with-and-without comparison. Field tools such as the web-vitals attribution build point to the script behind real slow interactions.
Turn this into a practical SEO action plan
Use RankLocalToday tools to check rankings, diagnose website issues, and prioritize the next organic traffic move.
Get your SEO plan →More in this topic: Website SEO, all 208 guides →