Interaction-Delayed Scripts
Holds back the analytics, pixels and chat widgets you choose until a visitor scrolls, clicks, taps or types, so your pages load faster.
Screenshots
Interaction-Delayed Scripts holds back the scripts you choose until a visitor scrolls, clicks, taps, types or moves the mouse. Analytics tags, ad pixels, heatmaps and chat widgets are some of the heaviest things on a page, and none of them need to run before someone actually uses it. Delayed, they stop competing with your content while the page loads, and PageSpeed Insights, which never interacts with a page, stops counting them against you.
Paste the snippets your services give you (Google Analytics, Tag Manager, Meta Pixel, Hotjar or a chat widget) and they're added to every page, already delayed. Or click Scan page: the plugin lists every script on that page, from other websites and from your theme and plugins, each with its own Delay switch. Known services are labeled, and the scripts that should load right away, like cookie consent, payments and captchas, carry a warning.
When the visitor interacts, delayed scripts run in their original order, along with the scripts that depend on them, and still get the ready and load events they wait for. A test mode, an optional timeout and a list of pages to skip let you roll it out safely. Find it under Content Powered > Interaction-Delayed Scripts, and get updates through the normal WordPress Updates screen.
Features
- Paste a snippet. Drop in your Google Analytics, Tag Manager, Meta Pixel or chat widget code and it waits for the first interaction.
- Pick from your site. Scan a page and switch on any script it loads, from other websites or from your own theme and plugins.
- Services recognized. About 60 analytics, ad, chat and embed services are labeled, with warnings on the ones that should load right away.
- Match by keyword. Delay any script whose address or code contains a keyword, on every page.
- Original order kept. Scripts run in page order, and scripts that depend on a delayed one wait with it.
- Ready events still fire. Scripts that wait for the page to finish loading still get their ready and load events.
- Test mode. Try it as an administrator before visitors get it, and add ?nodelay to any page to compare.
- Optional timeout. Load everything anyway a few seconds after the page loads, so analytics catch every visit.
- Cache friendly. Works with WP Rocket, LiteSpeed and other caches, and clears them when you save.
- Click Download above to save
interaction-delayed-scripts.zip. Leave it zipped. - In your WordPress dashboard, go to Plugins > Add New Plugin and click Upload Plugin.
- Choose the ZIP and click Install Now, then Activate Plugin.
To update later, upload a newer ZIP the same way. WordPress offers to replace the installed version and keeps your settings.
What Does Delaying a Script Until Interaction Mean?
The script stays in your page, but the browser doesn't download or run it while the page loads. The moment the visitor scrolls, clicks, taps, types or moves the mouse, it runs, in the same place and order it would have. Visitors still get your chat widget and your analytics still record the visit; the page just doesn't wait for them first.
Which Scripts Should I Delay?
Scripts from other websites that nobody needs the instant the page appears: analytics, ad and social pixels, heatmaps, chat widgets, video and social embeds and review widgets. Leave cookie consent, payment forms, captchas and your site's own menus and sliders alone unless you've tested them delayed. The scan flags the risky ones for you.
Will Google Analytics Still Count My Visitors?
Yes. A visit is counted as soon as the visitor scrolls, taps, clicks, types or moves the mouse, which almost every real visitor does. To also count the few who leave without touching the page, set Load anyway after to a few seconds.
How Is This Different From Defer or Async?
Deferred and async scripts still download and run while the page loads, so they still compete with your content and still show up in PageSpeed Insights. Delayed scripts don't download or run at all until someone interacts.
Can It Delay Scripts Added by My Other Plugins?
Yes. Scan a page and every script on it is listed with the plugin or theme that added it, from your contact form plugin to your page builder. Switch one on and the scripts that depend on it are delayed along with it, so nothing runs before the code it needs.
Does It Work With WP Rocket and Other Caching Plugins?
Yes. Your cache stores pages with the scripts already delayed, and saving the plugin's settings clears WP Rocket, LiteSpeed, W3 Total Cache, WP Super Cache, SiteGround and several others. If WP Rocket or Perfmatters is also set to delay JavaScript, the plugin tells you; just don't delay the same script in both.
What If Something Stops Working?
Switch that script off on the Scripts tab and save. If you're not sure which one it is, turn Delaying off under Settings and everything loads straight away again, with your choices kept for later.
- See https://github.com/jmsprsns/interaction-delayed-scripts/releases for the full release history.
Download
More Free WordPress Plugins
Thumbnail Size Manager
See every image size your site makes, where each one came from, how many files it has and whether anything uses it. Switch off the sizes you don't need, clean up their files after a dry run, and regenerate the rest.Disable Plugins Per Page
Turn plugins off on the pages that don't need them, before they load: rules by page, post type, URL pattern or device, admin rules, a test mode, safe recovery and before-and-after numbers. Free, with no Pro tier.Fast Social Share Buttons
Lightweight social share buttons that load only where they're used: inline, floating sidebar and mobile bar, with near-zero PageSpeed impact.Let's Grow Your Business
Want some free consulting? Let's hop on a call and talk about what we can do to help.
