Why WP Rocket's "Delay JavaScript Execution" Can Break Blue Tracely Visitor Identification

WP Rocket's Delay JavaScript execution holds the Blue Tracely snippet back until a visitor interacts with the page, so many visitors go unidentified. Exclude the snippet to fix it.

Summary

If your WordPress website uses the WP Rocket plugin, its Delay JavaScript execution setting can stop the Blue Tracely script from running when a visitor lands on a page. The script then waits until the visitor scrolls, clicks or taps.

Visitors who land, read and leave without interacting are never identified. A visitor who clicks a link to another page starts the script just as they leave, which gives it no time to report the visit. Many visitors go unidentified, and the ones who are identified show gaps in their page history.

To avoid this, exclude the Blue Tracely snippet from Delay JavaScript execution, so the script runs as soon as each page loads.

How Delay JavaScript execution works

Delay JavaScript execution is a WP Rocket setting that holds back the JavaScript on your pages until the visitor interacts with the page. WP Rocket lets you exclude scripts from it. See WP Rocket's documentation for how the setting works and how to exclude a script.

Why this impairs Blue Tracely's identification

Without delay, this is what happens on each page a visitor opens:

  1. The snippet runs as the page loads, and loads the Blue Tracely script.
  2. The script starts after the page has loaded, and then about 3 seconds more.
  3. It checks the visitor's consent and location, runs its identity checks, and reports the page view no sooner than about 9 seconds after the page loaded.
  4. On the next page the visitor opens, the same happens again, and the page views are grouped into one session.

With Delay JavaScript execution on:

  • The snippet doesn't run until the visitor scrolls, clicks or taps.
  • A visitor who reads the page and leaves without interacting is never reported.
  • A visitor whose first interaction is clicking a link leaves before the script has had its few seconds.
  • The result is missed page views, fewer identified visitors, and gaps in the Activity of the visitors who are identified.
  1. Find the snippet. It's the Blue Tracely tag you added to your site's header, for example through a plugin that adds code to the header. It contains the word bluetracely.
  2. Exclude it from Delay JavaScript execution. In WP Rocket, add the snippet to the scripts that Delay JavaScript execution leaves alone. The word bluetracely identifies it. WP Rocket's documentation explains where to add the exclusion.
  3. Clear your caches. Clear WP Rocket's cache, and any other page cache your site uses.
  4. Check the installation. On the Script page, select Test script next to your domain. If the snippet is on your pages but the check says it can't find the script, a setting that delays scripts is a likely cause.
  5. If the exclusion doesn't work, turn the setting off. If you can't keep Delay JavaScript execution from holding back the snippet, turn it off for your site so that Blue Tracely can identify your visitors.

Other optimization plugins and services can have similar settings that delay scripts until the visitor interacts with the page. The same fix applies: exclude the Blue Tracely snippet from them.

For more on why the script needs to run as soon as the page loads, see The Impact of Script Placement on Profile Collection Efficiency.