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

Set up a CNAME

In order to use your own domain name to deliver the JS Tag and expose the API endpoint, please follow these steps:

  1. Send an email to [email protected] with the desired domain name. Ex: subdomain.domain.com
  2. We will then send you a CNAME record to add to your DNS server in order to validate the generation of our SSL certificate
  3. As soon as our SSL certificate is deployed on our infrastructure, we will then send you a notification by email and you can continue with the configuration of the tag loader

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/.