JavaScript Tag

The JavaScript Tag installation is required for optimizing the efficiency of bot detection. Combined with the server-side module, the JavaScript Tag helps the DataDome algorithms understand how and by whom a JavaScript is executed on your website.

Install the Tag

Get your JS Key from your dashboard, copy the code and paste it at the start of the BODY tag, as shown below:

!function(a,b,c,d,e,f){a.ddjskey=e;a.ddoptions=f||null;var m=b.createElement(c),n=b.getElementsByTagName(c)[0];m.async=1,m.src=d,n.parentNode.insertBefore(m,n)}(window,document,"script","","YOUR_DATADOME_JS_KEY", { ajaxListenerPath: true });

The JS tag is loaded asynchronously.

Single Page Application

In case you are using a Single Page Application (SPA), please follow our SPA dedicated documentation.


To integrate the JavaScript Tag on a website that uses Content-Security-Policy (CSP), you need to add all the following changes to the CSP instructions:
style-src: "unsafe-inline" since we create (and delete) an element and append it to the DOM with some style modifications. It's invisible to the user and enables us to compute some properties related to the screen size.
script-src: "unsafe-inline" for the Tag loader that is directly inlined in the HTML.
script-src: "" to load the JavaScript Tag (call made by the Tag loader).
connect-src: "" to send the fingerprint back to the API server.

  • frame-src: "" to allow the CAPTCHA to load.