Analytics, tag managers, chat widgets, ad pixels and heatmaps load on every page, and together they often weigh more than the rest of the page. None of them are needed in the first second. Delaying them until the visitor first scrolls, taps, clicks or moves the mouse makes the first view much faster and the page more responsive. After page caching, it is usually the biggest improvement to speed scores.
Turn it on (Keel Pro)
- Open Keel › Speed › Delay scripts.
- Switch on Delay third-party scripts.
- Review Delay scripts containing: one pattern per line, matched against each script’s address or the code of inline scripts. Common examples are
googletagmanager.com,connect.facebook.netand your chat provider’s domain. - Press Browse to add the site’s own script files if you want to delay those too, for example a heavy widget only used further down the page.
- Save.
Delayed scripts run in their original order as soon as the visitor interacts.
Keep analytics counting readers
A visitor who reads without touching anything never triggers delayed scripts, so analytics would not count them. Run them anyway after (seconds) fixes that: 10 keeps analytics counting visitors who only read, while keeping almost all of the speed gain. 0 waits for an interaction no matter how long.
What not to delay
- Scripts the first screen needs: a menu toggle, a slider at the top.
- A cookie consent banner that must appear before any tracking.
- Payment scripts on cart and checkout pages.
- Captcha scripts on forms people might submit quickly.
To keep any script from waiting, add data-no-delay to its script tag, or remove its line from the list.
Test after turning it on
- Open a page in a private window. Scroll or tap, and check that the chat bubble, cookie banner and pop-ups appear.
- Submit a form.
- Open your analytics real-time view and check your visit is counted, both when you interact and when you wait without touching anything.
- On a shop, complete a test order.
If something breaks, see a page looks broken after turning on minify or delay scripts.
Measure
Compare PageSpeed Insights on mobile before and after. Total Blocking Time and the “Reduce JavaScript execution time” list should drop sharply.
Every setting on this screen
The same explanations you see next to each setting in Keel.
Keel › Speed › Delay scripts
| Setting | What it does |
|---|---|
| Delay third-party scripts (Pro) | Usually the biggest speed-score gain after caching. Delayed scripts run in their original order. Check that chat and tracking still work after turning it on; a visit that leaves without any interaction may not be counted in analytics until the time below has passed. |
| Delay scripts containing (Pro) | One per line. Matched against the script address, or the code of inline scripts. Browse adds the site's own script files. Add data-no-delay to a script tag to never delay it. |
| Run them anyway after (seconds) (Pro) | 0 waits for an interaction no matter how long. 10 keeps analytics counting visitors who only read. |