AFL UTM Tracker Documentation

  1. Home
  2. Docs
  3. AFL UTM Tracker Documentation
  4. Misc / Issues
  5. WP Rocket Setup

WP Rocket Setup

If your website uses the WP Rocket plugin, you may have certain settings which can prevent our JavaScript file from proper and accurate tracking.

  • Do you have “Load JavaScript Deferred” setting enabled? If yes, you would need to exclude our javascript files for accurate tracking.
  • Do you have “Delay JavaScript Deferred” setting enabled? If yes, you would need to exclude our javascript files for accurate tracking.

This is because WP Rocket will only load the JavaScript files when the user clicks/scrolls on the page. If the user navigates away to another page without scrolling the page, our JavaScript does not get loaded and you will get an inaccurate landing page and attribution.

It is the same for Google Analytics

The Delay Javascript Execution feature in WP Rocket will also caused your Google Analytics traffic data to be highly inaccurate. Here is WP Rocket mentioning the issue on their documentation site.

Where to check?

  1. Login to your WordPress admin dashboard.
  2. Go to WP Rocket > File Optimization.
  3. Check if the following settings are enabled.

Load JavaScript Deferred

Under the Excluded JavaScript Files text box, enter the following path:

/wp-content/plugins/afl-wc-utm/public/js/afl-wc-utm-public.min.js

Delay JavaScript Execution

Under the Excluded JavaScript Files text box, enter the following path:

/wp-content/plugins/afl-wc-utm/public/js/afl-wc-utm-public.min.js

Did you integrate any cookie consent banner plugin with our plugin?

Depending on which Cookie Consent Integration that you are using, you may need to exclude one of the following:

/wp-content/plugins/afl-wc-utm/public/js/borlabs-cookie.min.js
/wp-content/plugins/afl-wc-utm/public/js/complianz.min.js
/wp-content/plugins/afl-wc-utm/public/js/cookiebot.min.js
/wp-content/plugins/afl-wc-utm/public/js/cookie-script.min.js
/wp-content/plugins/afl-wc-utm/public/js/manual.min.js
/wp-content/plugins/afl-wc-utm/public/js/onetrust.min.js

Clear Cache

Next save changes and clear all page cache for the settings to take effect.

Screenshot

WP Rocket > File Optimization
WP Rocket > File Optimization