JavaScript Tag Customization

By default, the JavaScript Tag and the callback are using DataDome domain name.
The JS tag is located at https://js.datadome.co/tags.js
The callback is pushed to https://api-js.datadome.co/js/

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
  • Change the JS tag loader

Setup a CNAME

In order to use your own domain name to deliver the JS tag and the callback, 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 could continue with the configuration of the tag loader.

Configure the tag loader

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

<script>
!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","https://subdomain.domain.com/tags.js","YOUR_DATADOME_JS_KEY", {endpoint: 'https://subdomain.domain.com/js/', ajaxListenerPath: true});
</script>

After that, the tags.js will be delivered by subdomain.domain.com/tags.js and the callback to our endpoints will be sent through subdomain.domain.com/js/