DataSag guides · Updated 27 October 2026
Load analytics without blocking rendering on HTML websites
Use the platform's non-blocking external script mechanism and install the tracker once. Measure the published page before and after the change; script size alone cannot predict the effect on your website. This guide applies to HTML websites.
Start with the HTML websites installation
Paste the script into head in your shared HTML template. If the site has no shared template, add it to each document you want measured. Replace the example public key, upload the changed files and check a nested page as well as the homepage.
A homepage-only edit misses independent HTML documents. If you later introduce shared includes, remove old per-page copies so the final rendered page has one tracker.
Use the public project key from the DataSag project you are inspecting. A test on a preview domain does not confirm that the production domain has the same code or settings.
Load analytics without blocking rendering in HTML websites
- Use defer on the external tracker in each intended document or shared head include. Preserve the script public key and remove an obsolete synchronous copy from the final rendered HTML.
- Measure the deployed files over HTTP with consistent cache and network settings. Opening a local file or comparing different server-cache states does not reproduce the document and network behavior visitors receive.
- Test a nested document as well as the homepage. Inspect first-action coverage and execution cost alongside download timing. A small cached transfer can still hide duplicated script execution left in a shared include.
The served documents use one deferred installation each, with performance and first-action coverage measured on the actual host.
Complete the collection checks
- Record a baseline of the published page using the same browser, device emulation and network settings you will use for comparison. Include a representative content page, not only the homepage.
- Use defer for a normal external HTML script, or the framework-specific loading strategy shown in the installation example. Do not add a parser-blocking synchronous script as a shortcut.
- Keep one installation in the shared document or layout. Duplicate execution adds work even if the browser reuses the downloaded file.
- Inspect the Network waterfall for tracker.js and /api/track. Compare transfer size, timing and request count on a cold load and a cached load.
- Check that measurement still starts at the intended point. Loading only after idle or interaction can omit short visits and early clicks; performance and coverage must be evaluated together.
- Repeat the measurements and record variability. Report measured results for your page rather than claiming a universal speed improvement or zero performance cost.
// Browser Console, after loading the published page:
performance.getEntriesByType('resource')
.filter(entry => entry.name.includes('/tracker.js'))
.map(entry => ({ url: entry.name, durationMs: entry.duration }));
// Cross-origin transfer details may be unavailable.What a successful check looks like
The script uses a non-blocking loading mechanism, appears once and records the intended visits. Any performance claim comes from repeatable measurements of the actual site.
Record the public path you tested, the browser state, the approximate time and the observed request. Check one direct page load and one later navigation so the result covers more than the homepage.
Common mistake
A faster lab result does not prove every visitor has a faster experience. Avoid mixing a warm-cache result with a cold-load baseline.
Installation snippet for HTML websites
The shared installation belongs in the head of every HTML document or shared template. Use this as the installation reference while checking the procedure above.
<script defer src="https://www.datasag.com/tracker.js" data-datasag-key="YOUR_PUBLIC_KEY"></script>Related HTML websites guides
References
Official HTML websites documentation covers the integration point. For DataSag data handling, read the privacy policy. Use support if a request fails after these checks.