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:
- The JS Tag is located at https://js.datadome.co/tags.js
- The API endpoint is defined as 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
- 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:
- Send an email to
[email protected]
with the desired domain name. Ex:subdomain.domain.com
- We will then send you a CNAME record to add to your DNS server in order to validate the generation of our SSL certificate
- 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/
.
Updated about 1 month ago