> For the complete documentation index, see [llms.txt](https://developers.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.didomi.io/cmp/web-sdk/consent-notice/custom-domains-for-events.md).

# Custom domains for events

{% hint style="danger" %}
This section describes how to configure the Didomi consent notice through its programmatic API and the `window.didomiConfig` object.

Most configuration options are available through the [Didomi Console](https://console.didomi.io/), and this documentation only applies to edge cases or custom implementations that require it.
{% endhint %}

In some hybrid apps (Electron, Cordova, etc.), the `location.host` value used by the Web SDK is not defined. This can cause the following issue in analytics data and events:

* Your organization has a lot of page views with no consent rate.

A custom domain can be set as part of the `didomiConfig` object to ensure that some domain is associated with API events for those applications.

You can add a `customDomain` property to the `app` object in the configuration:

```javascript
window.didomiConfig = {
  app: {
    customDomain: "custom.app.domain",
  },
};
```

{% hint style="warning" %}
Please ensure that you specify a valid domain in one of the following formats:

* A valid DNS name

  **Example:** `sandbox.domain.io`, `www.domain.io`
* A valid iOS bundle ID or Android package ID

  **Example:** `com.example.app`, `com.example.app.ios`, `com.example.app.macos`

Otherwise, it will be filtered out and not included in your analytics event data.
{% endhint %}

This configuration option is also available in the [Didomi Console](https://console.didomi.io/) as part of the Custom JSON field in the `Customization` tab.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.didomi.io/cmp/web-sdk/consent-notice/custom-domains-for-events.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
