Skip to main content
Choose an implementation option
Language

Set up fingerprinting

Choose how to deploy cside fingerprinting on your website using Cloudflare Workers, Google Tag Manager, direct script injection, or an NPM package.

Set up cside fingerprinting by loading the browser script early, collecting telemetry with sendClientTelemetry, and sending the returned session token to your backend.

Choose an implementation option

MethodBest forProduction guidance
Cloudflare WorkersSites already routed through CloudflareGood for edge injection and limited-path rollout
Direct script injectionMost production websitesRecommended when you control the HTML or app shell
NPM packageFramework apps with supported packagesRecommended when the package places the script early
Google Tag ManagerQuick validation without code changesUse for testing only when script order matters

Customer domain recommendation

Use the DNS setup to use your own domain where possible. cside offers this to avoid privacy concerns around third-party domains, make the script look first-party to the browser, and prevent browser ad blockers or client-side blocking from interfering with the script or impacting detection accuracy.

If cside provides a dedicated script URL, use that exact URL in every setup method. The examples below use placeholders.

Serve the script from your own domain

This option lets you serve the fingerprinting script from a subdomain you control, such as fingerprint.example.com. It is intended for production accounts that want first-party script delivery and tighter CSP control.

Account-enabled setup

Custom fingerprint domains require cside to provision a target hostname for your account. Contact cside before adding DNS records.

DNS setup

  1. Choose a subdomain, for example fingerprint.example.com
  2. Ask cside for your fingerprinting target hostname
  3. Add a CNAME record from your subdomain to the cside target
  4. Wait for DNS to propagate and for cside to validate the hostname
  5. Use your subdomain as the script source

Example DNS record:

TypeNameValue
CNAMEfingerprint.example.com<YOUR_TEAM>.csidefd.com

After validation, use the customer-domain script URL:

<script
  src="https://fingerprint.example.com/client.js"
  referrerpolicy="origin"
  data-src="6">
</script>

Update your CSP to allow the customer subdomain for script-src and connect-src.

Direct script injection

Add the script in the page <head> before you call fingerprinting functions.

<script
  src="https://<YOUR_SUBDOMAIN>.csidefd.com/client.js"
  referrerpolicy="origin"
  data-src="6">
</script>

Then call sendClientTelemetry after the script loads. You can call it with no arguments or pass an optional externalIds object.

const response = await sendClientTelemetry({
  accountId: "customer-123",
  orderId: "order-456",
});

const { token: sessionToken } = await response.json();

Send the session token to your backend and exchange it with the cside API. See the Events API for the full flow.

NPM package

For supported frameworks, use the cside package that adds the browser script to the app shell. This is useful when your framework controls document rendering.

The package should still load the same cside script before your app calls sendClientTelemetry.

Please contact the cside team for help if interested in using the NPM installation method.

Google Tag Manager

GTM is useful for fast testing, but it does not guarantee that cside loads before other scripts. Use a Custom HTML tag with an All Pages trigger when validating the flow.

Use GTM for validation

For production enforcement or high-confidence data collection, use direct script injection, an NPM package, or Cloudflare Workers.

Cloudflare Workers

Use Cloudflare Workers when traffic already passes through Cloudflare and you want edge-controlled script injection. See the Cloudflare Workers guide.

Was this page helpful?