Cache plugins are essential tools for boosting the performance of a WordPress site, reducing load times and optimizing resources. They provide features like page caching, minification and combination of CSS and JavaScript files, deferred script loading, and image optimization.
However, some of these optimizations can conflict with My Agile Pixel®, causing issues with proper functioning. To keep both high performance and complete tracking, certain files must be excluded from cache plugin optimizations. Here’s how to do it:
Do you use WP Rocket, LiteSpeed Cache, SiteGround Speed Optimizer or Autoptimize? Since My Agile Pixel® 3.4.1 the plugin keeps its own scripts out of their optimizations by itself (guides: WP Rocket, LiteSpeed Cache, SiteGround Speed Optimizer). The steps below are for other cache plugins, for earlier versions of My Agile Pixel®, or if you still notice problems.
Excluding JavaScript Files
The plugin’s JavaScript files should not be minified or loaded in a deferred or delayed way.
To keep tracking working correctly, follow these steps:
- Access the cache plugin settings and go to the section for JavaScript optimization.
- Find the options for minification and deferred/delayed script loading.
- Enter the following files in the exclusion fields:
/wp-content/plugins/myagilepixel/frontend/(.*).js
/wp-content/plugins/myagilepixel/local-cache/my-agile-pixel/(.*).js
localcdn.myagilepixel.comUntil the local copy is ready (for example right after installation), the scripts come from localcdn.myagilepixel.com: exclude this domain too.
Excluding CSS Files
Exclude the following CSS files from optimization so the plugin’s assets load correctly:
- In your cache plugin, go to the CSS optimization section.
- Add these files to the CSS exclusion fields:
/wp-content/plugins/myagilepixel/frontend/css/(.*).cssDepending on your plugin, you may also need to disable:
- CSS minification
- Combine CSS
- Asynchronous CSS loading
If you still encounter issues with tracking, contact our support service or the support team for your cache plugin.
By following these simple steps, you can guarantee correct operation of your tracking without sacrificing your website’s performance.
Frequently asked questions
Recover the conversions you are losing
Turn on server-side tracking on your WordPress: recover the events the browser blocks, after consent.
Buy now →
