DataUnlocker Defender concepts

DataUnlocker Defender protects your analytics and tracking products from blockers, removing detectable patterns in network requests and shielding critical JavaScript APIs.

Network traffic protection
DataUnlocker Defender encodes network requests so that they don't contain patterns

This way, blockers simply don't have tools to target your analytics and tracking products.

What is DataUnlocker Defender exactly?

DataUnlocker Defender is a frontend JavaScript integration that loads your analytics and marketing tools through a secure, encrypted channel, safeguarding it from ad blockers and privacy extensions. Once installed, it ensures that your tracking products are delivered safely — even under hostile browser conditions — by making your analytics an integral part of your web application — one it can't run without.

It works by:

  • Loading the DataUnlocker core via a secure transport endpoint
  • Protecting key JavaScript APIs from tampering
  • Routing network requests through obfuscated and encrypted network channel, your transport endpoint
  • Rendering the app non-interactive if Defender or the transport endpoint is blocked, preventing easy workarounds by blockers

Learn more in How It Works.

How to install Defender

There are two installation options depending on your tech stack, covered in detail here.

1. NPM integration (Recommended for React, Angular, Svelte, etc.)

Install the @dataunlocker/defender or framework-specific package. This setup allows tight coupling between your app and DataUnlocker.

2. JavaScript file patching

For sites built with CMSs, no-code tools, or static site builders, you can upload a JS file (e.g. containing any critical library your site depends on) and receive a patched version that includes DataUnlocker Defender.

Secure Enclave and Network Protection

For full protection, Defender works in tandem with:

  • Secure Enclave — where you can store your tracking code (e.g. GTM, Pixel, Hotjar) in an obfuscated, JavaScript-protected vault that loads after Defender inits.
  • Network Protection — which lets you configure proxy for blocked domains and resources through your transport endpoint, optionally activating only when a blocker is detected.

Learn more about it in configuration.

How DataUnlocker Defender works

When loaded on your site, DataUnlocker Defender:

  1. Establishes a secure, encrypted connection with the DataUnlocker backend and all configured resources in Network Protection via a transport endpoint hosted on your domain.
  2. Monitors for blocking or tampering attempts (e.g. stubbed APIs, JS overrides, no-op functions).
  3. Enforces integrity by:
    • Obfuscating and rerouting network calls.
    • Shielding native JS methods like setTimeout, Math.random, etc.
    • Triggering Limited Mode if tampering is detected, thus preventing tampering itself.
  4. Initializes analytics and tracking tools after the core is fully active and the environment is validated.

When to use Defender

You should use DataUnlocker Defender if:

  • You're losing tracking data due to browser extensions, DNS-level blocks, firewalls or privacy browsers
  • You want full visibility into your website's visitors behavior without compromising speed or SEO
  • You're using any frontend-based analytics (Google Analytics, Facebook Pixel, HotJar, Segment, etc.)
  • You require a future-proof setup that evolves against new blocker techniques automatically

What Defender does not do

  • Defender does not replace your analytics tools — it protects and enhances them.
  • It does not collect any visitor data itself.
  • It does not run on legacy browsers (e.g. Internet Explorer) or no-script environments.

Related pages