Serve Didomi assets from your domain (web)
By default, Didomi relies on the privacy-center.org domain when serving assets- whether that is to load a consent notice, a preference center, or a privacy request widget, Didomi's SDKs and integrations, including their assets (JavaScript files, images, etc.) and API requests.
In this article, we will cover how to configure your integration so that these assets are served from your organization's own domain instead when utilizing the Didomi web SDK.
Configure custom domain
Didomi offers two options when configuring the custom domain that will be used to serve Didomi assets.
The SDK will load Didomi assets via your domain but all the infrastructure will be handled by Didomi.
The SDK will load assets from your domain and infrastructure. This ensures that requests are processed and cached on your own servers while allowing you to use the latest version of the SDK and its consent notice configuration.
Configure the web SDK
Once your organization's custom domain is configured, the Didomi web SDK needs to be configured to used this domain for three types of requests:
loader.jsrequest from embed codeChunks loaded by the web SDK
Requests sent to the API by the web SDK
In the sections below, we will cover how to update the embed code and web SDK to utilize your organization's custom domain.
Update embed code
Didomi products are implemented on your website via an embed code that was first retrieved from the Didomi console. This embed code needs to be updated by replacing https://sdk.privacy-center.org with your custom domain.
This ensures that the first request to load the Didomi SDK (the loader.js file) uses your custom domain.
Update SDK configuration
For other JavaScript files loaded by the Didomi web SDK, your organization must configure which paths to use by setting values for sdkPath and apiPath in the window.didomiConfig object.
For security reasons and to avoid injecting JavaScript on your website from the Didomi console, the sdkPath and apiPath properties cannot be set via Custom JSON in the Didomi console.
They must be set directly on your website via the window.didomiConfig object.
The sdkPath property must start with http://, https://, or //. It must also end with a final /. The apiPath property must start with http://, https://, or //.
Last updated