A fast website matters to your visitors. The Blue Tracely script is built to stay out of your page's way: it loads in the background, and it doesn't start its work until your page has loaded. This article explains how.
Asynchronous loading: a primer
A script on a web page can load in two ways. A normal (synchronous) script makes the browser stop reading the page until the script has downloaded and run. An asynchronous script downloads alongside the page, and the browser keeps reading and showing the page in the meantime.
How Blue Tracely's script loads
The snippet you copy from the Script page is one short tag. It does two things:
- It adds the Blue Tracely script to the page as an asynchronous script, so your page keeps loading while the script downloads.
- It does nothing if the script is already on the page, so a snippet that's pasted twice doesn't run twice.
Once the script has downloaded:
- It waits for your page. It starts only after the page has loaded, and then about 3 seconds more.
- Its identity checks run side by side. It asks several identity partners at the same time, and gives each at most 3 seconds to answer.
- It sends one small request. When it has its answers, it sends what it found to our servers in a single request. It doesn't wait for a reply and doesn't retry.
- It's delivered efficiently. The script file is compressed and served over HTTPS from a content delivery network, and browsers keep a cached copy of it.
What this means for identification
Because the script waits for your page before it starts, it reports a page view no sooner than about 9 seconds after the page loads. A visitor who leaves sooner isn't reported from that page. That's the trade-off for staying out of your page's way, and it's why the snippet belongs in the <head>, where the script can load as early as possible. See The Impact of Script Placement on Profile Collection Efficiency.
Keep it asynchronous
- Use the snippet as the Script page gives it. Don't edit it, and don't replace it with a plain script tag. If Test script on the Script page reports that your website is running a different version of the script, copy the snippet again.
- Don't host the script file yourself. The script only runs when it's loaded from our address.
- Don't delay it further. Plugins that hold scripts back until the visitor interacts with the page stop it from running for visitors who don't. See Why WP Rocket's "Delay JavaScript Execution" Can Break Blue Tracely Visitor Identification.
Conclusion
Blue Tracely's script loads in the background and waits for your content, so your visitors see your pages first, and the script does its work after.