Darwinium JavaScript profiling runs in your customer's browser while they use a page. It collects details about the device, the network connection and how the person types, clicks and swipes. That data feeds the rules and models that separate genuine customers from fraudsters and automation.
For what profiling collects and how it reaches Darwinium, see Profiling explained.
Two ways to add profiling to a page
- Through the edge: our edge worker adds profiling to your pages on the CDN. See Insert JavaScript profiling at the edge.
- As a JavaScript tag: your developers add the profiling script to your pages and call it from your code. See Install JavaScript tags.
The profiling code is the same either way, and most options are shared. What changes is who adds the script to the page and who sends the result to Darwinium.
| Through the edge | As a JavaScript tag | |
|---|---|---|
| Who adds the script | Our edge worker, on the CDN, as the page loads | Your developers, with a <script> tag |
| Who starts and collects profiling | Automatic | Your code calls start() and collect() |
| How the result reaches Darwinium | Added to the next request as the dwn-profiling header (or a hidden form field), then read by the edge worker |
Your backend sends it in the dwn-profiling header of an Event API call |
| Changes to your site | None, all set in the Darwinium Portal | Script tag, start/collect calls, backend API call |
| Needs | A CDN deployment (Cloudflare, CloudFront, Akamai) | A subdomain on your site to serve the script |
| Best for | Sites already on a supported CDN, and adding profiling to new pages without a release | Single-page apps, mobile web, or when you want precise control of when profiling starts and stops |
Through the edge, the edge worker reads the dwn-profiling header on the submit request and creates the event. It can also pass risk headers on to your server.
.png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A35%3A28Z&se=2026-11-19T12%3A47%3A28Z&sr=b&sp=r&sig=l%2BaLLvJDFi0loClXJhEe%2BTTh%2B%2FoTTjsR7mysZEy4qiI%3D)
As a JavaScript tag, your backend receives the header and sends it to a Darwinium API step, which returns the risk response.
.png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A35%3A28Z&se=2026-11-19T12%3A47%3A28Z&sr=b&sp=r&sig=8rKKw%2BN9zGh2TMb1H30%2FTr%2BPE1zkWx2WaFVthLPbIr0%3D)
You can use both on one site. For example, the edge for login and registration pages, and tags inside a single-page checkout.
Choose where the script runs on the page
Profiling can sit in the page's <head> or <body>. Either way, the script is added at the start of that section and starts collecting once the page has loaded.
We recommend <head>, so profiling is ready before your own scripts send requests.
Choose the options
Both methods share most options: which data to collect (biometrics, geolocation), which detections to run (remote desktop, browser extensions, developer tools) and limits on how large the result can get. See JavaScript profiling snippet options.
Before you go live
Your site's Content Security Policy, CORS, Permissions-Policy and header size limits can stop profiling working, often without an obvious error. Check Site requirements for JavaScript profiling during setup and after changing them. The page is private: sign in through the Portal (see Help & documentation access) or ask your Darwinium contact.