It also works great for things like cart fragments which is a common WooCommerce performance issue due to the fact that the AJAX request can’t be cached. You can also use it with our local analytics feature and Instant Page.
- Delay timeout
- Examples of scripts you can delay
- Delay versus defer
Click into the Perfmatters plugin settings.
Click on the “Extras” tab and the “Assets” sub-navigation menu.
example.js (one per line).
Scroll down and click “Save Changes.”
You can set a timeout (in seconds), which will load scripts after a set amount of time if no user interaction has been detected. This can help improve tracking scripts accuracy, especially if you have a page with a goal associated with a pageview, but maybe no user interaction.
You can choose a timeout between 1 and 10 seconds. This is optional and off by default.
We can add
Examples of scripts you can delay
Below are some examples of common scripts we delay on WordPress sites.
Delay Google Analytics
ga( ' ga(' google-analytics.com/analytics.js
If you’re using our local analytics, you can also delay the scripts.
Local Perfmatters analytics.js
Local Perfmatters gtag.js v4
Local Perfmatters Minimal
Delay Google Tag Manager
Delay Facebook Pixel
fbevents.js fbq( /busting/facebook-tracking/
Above are just a few of the many examples of scripts you can disable. If you are having any trouble delay a certain script, feel free to contact us.
Delay versus Defer
The good news is, you can use both delay and defer simultaneously.