JavaScript Tag Customization

By default, a domain owned by DataDome is used as the origin of the JavaScript Tag and for the API endpoint that will receive additional signals:

For performance reasons or security concerns, it may be relevant to use a customized domain name.
It requires two simple actions:

  • Create a CNAME on your domain name to point to our infrastructure
  • Update the JS Tag loader accordingly

Configure the tag loader

To modify the URL that will load the JavaScript Tag, you need to modify the code snippet below with the URL using the new domain name.
To modify the URL of the API endpoint, you need to add the endpoint option in the JavaScript Tag loader as shown in the example below:

<script>
  window.ddjskey = 'YOUR_DATADOME_JS_KEY';
  window.ddoptions = {
    endpoint: 'https://subdomain.domain.com/js/',
    ajaxListenerPath: true
  };
</script>
<script src="https://subdomain.domain.com/tags.js" async></script>

After that, the tags.js script will be delivered by subdomain.domain.com/tags.js and the additional signals will reach our API through subdomain.domain.com/js/.