LogoLogo

The impact of next/script on FID in Landing Pages

Published

Next/Script: How One Analytics Tag Can Tank Your Landing Page SEO

I’m going to be real with you: most landing pages I audit are bloated messes. The marketing team wants Google Tag Manager, Facebook Pixel, Hotjar, and three different chat widgets. Each one of those is a nail in the coffin of your First Input Delay (FID). I’ve seen pages that look ready but won’t respond to a user’s click for five full seconds. In 2026, Google is done being patient with slow scripts. If you aren’t mastering the next/script component, you’re basically letting third-party vendors run your SEO strategy into the ground.

The "Main Thread" Hostage Situation

Every time you add a standard <script> tag, the browser stops everything to download and execute it. If that script is heavy, your main thread is locked. I remember a project where the site had a 95 Lighthouse score for LCP but an FID of 400ms (anything over 100ms is a red flag). The culprit? A "human-friendly" chat widget that was anything but dev-friendly. It was hijacking the main thread during the most critical part of the page load. I call this "JavaScript Hijacking," and it's an SEO death sentence for conversion-heavy landing pages.

Technical Real-Talk: Stop using the afterInteractive strategy for everything. If a script isn't essential for the first 5 seconds of user experience (like a tracking pixel), use the lazyOnload strategy. Better yet, if you're on a modern Next.js setup, use the worker strategy to move the script to a Web Worker entirely.

Mastering Loading Strategies

The next/script component isn't just a wrapper; it's a traffic controller. By choosing the right strategy, you decide when the "JS Tax" gets paid. In my experience, moving analytics to lazyOnload can improve FID by up to 60%. Why? Because you’re giving the browser permission to prioritize user interaction over marketing tracking. As I discussed in my guide on Reducing TBT, the main thread is your most precious resource. Don't waste it on a script that the user doesn't even see.

Strategy Comparison: When to Use What

Strategy Execution Time SEO Use Case FID Impact
beforeInteractive Before hydration Critical Auth/Bot detection High (Dangerous)
afterInteractive Immediately after Tag Manager / Primary Ads Medium
lazyOnload Idle time Chat widgets / Feedback forms Low (Safe)
worker Off-thread Analytics / Pixels Near Zero

Combining this with proper LCP prioritization creates a "Fast Path" for both the user and the crawler. I’ve seen this "Surgical Scripting" approach move sites from "Needs Improvement" to "Good" in Search Console in less than a month. It’s not about removing features; it’s about timing their arrival.

Conclusion: Don't Let Third Parties Rule Your Rank

In 2026, technical SEO is a game of control. You need to be the one who decides when and how JavaScript executes on your site. Use next/script to put your third-party vendors on a diet. Test your FID on mid-range mobile devices, not just your high-end dev machine. I’ve learned the hard way that a site that doesn't respond is a site that doesn't convert—and Google knows it. Protect your main thread like your rankings depend on it, because they absolutely do.