You can use your own domain, such as analytics.example.com, to access Piwik PRO, load tracking resources, or send tracking events.
This article explains how to add and manage a custom domain, set it as the account default, or use it for an individual site or app.
Before you start
Here are some important things to keep in mind before you start:
- You need owner permission to add or edit custom domains and manage the account’s default domains.
- To set up domains for an individual site or app, you need publish permission for that site or app.
- Your domain must have a CNAME record that points to {organization}.piwik.pro. DNS changes may take up to 24 hours to propagate. See how to configure a CNAME record in Azure or AWS.
- If you manage the certificate yourself, renew it and upload the updated files before it expires to avoid service interruptions. Read more.
- If your website uses a CSP, you may need to update its settings to allow tracking resources and requests through your custom domain.
Add a custom domain
To add a new custom domain, follow these steps:
1. Go to Menu > Administration > Account.
2. In Domains, find the Domains list.
3. Click +Add a domain.

4. Enter your custom domain, for example, analytics.example.com.
5. In Can be used for, select one or more options:
- UI & APIs: Use the domain to access the Piwik PRO interface and APIs. This domain also appears as your account address in email notifications.
- Static tracking resources: Use the domain to load tracking resources referenced in the installation snippet.
- Tracking endpoints: Use the domain to send tracking events to Piwik PRO.

6. In Certificate, choose how the certificate is managed:
- Managed by us (recommended) – We automatically issue and renew the certificate.
- Managed by you – You upload the certificate files and renew the certificate yourself.

Note: If you manage the certificate yourself, renew it and upload the updated files before it expires to avoid service interruptions.
7. If you select Managed by you, upload the following files:
- Certificate chain: Upload the certificate chain in PEM format (
.pem,.crt, or.cer). The leaf certificate must appear first in the file.
- Private key: Upload the private key in PEM format (
.pemor .key), encoded using PKCS#8.

Note: Both the certificate and private key must use RSA encryption. ECC/ECDSA certificates aren’t supported, including certificates that use the prime256v1 (P-256) curve.
8. Click Add.
Your new domain appears in the Domains list. Processing it may take some time.
Note: You can add up to 10 custom domains.
Edit a custom domain
You can change what your custom domain is used for and how its certificate is managed.
To edit a custom domain, follow these steps:
1. Go to Menu > Administration > Account.
2. In Domains, find the Domains list.
3. Click the three-dot ⋯ icon next to the domain and select Edit.

4. Under Can be used for, select one or more options:
- UI & APIs
- Static tracking resources
- Tracking endpoints

Note: Changing what your domain can be used for may affect where you can select it in your account.
5. In Certificate, choose how the certificate is managed:
- Managed by us (recommended): We automatically issue and renew the certificate.
- Managed by you: You upload and renew the certificate files yourself.

6. If you switch to Managed by you, upload the required certificate chain and private key. If you already manage the certificate yourself, you can replace the existing files when needed.

Note: If you switch from Managed by us to Managed by you, you’ll need to renew the certificate and upload updated files before it expires.
7. Click Save.
Use your custom domain in default setup
Choose which domains to use by default across your Piwik PRO account. These settings apply to all sites and apps unless you override them individually.
To use your custom domain in default setup, follow these steps:
1. Go to Menu > Administration > Account.
2. In Domains, find the Default setup.
3. Navigate to Account.

3. Choose a domain from the drop-down list for each setting you want to change:
- UI & APIs
- Static tracking resources
- Tracking endpoints

Note: If you change the domain for static tracking resources, update the installation snippets on all pages where they’re installed.

If your custom domain doesn’t appear in a drop-down list, check that it’s configured for that use and has a valid certificate. You can check its permitted uses in the Domains list.
You can switch back to the default Piwik PRO domains whenever needed.
Set up a custom domain per site or app
You can use different domains for individual sites or apps without changing your account’s default settings.
To set up a custom domain per site or app, follow these steps:
1. Go to Menu > Administration > Sites & apps.
2. Select a site or app.
3. Go to Data collection > Domains.
4. In Domains setup, click Edit.

5. Choose a tracking type:
- Standard (client-side tracking): Select the domains you want to use for the Piwik PRO API, static resources, and tracking events.
- First-party collector (hybrid server-side tracking): Enter the required API domain, static resources address, and tracking address. Read more

6. Configure the following settings based on your selected tracking type:
Standard (client-side tracking)
- Piwik PRO API domain: Used to query visitor audiences from your site or app.
- Static resources domain: Used to load tracking resources referenced in the installation snippet. If you change this domain, update the installation snippets on all pages where they’re installed.
- Tracking domain: Used to send tracking events to Piwik PRO.

Note: If your custom domain doesn’t appear in a drop-down list, check that it’s configured for that use in Administration > Account > Domains.
First-party collector (hybrid server-side tracking), configure the following fields:
- Piwik PRO API domain: Enter the domain used to access the Piwik PRO API.
- Static resources address: Enter the domain, Container JS path, and Tracking script path.
- Tracking address: Enter the domain and the tracking endpoint path.
These settings must match your first-party collector configuration. See Install a first-party collector for detailed setup instructions.

Note: Incorrect first-party collector settings can interrupt data collection. Make sure the addresses and paths match your tracking setup before saving.
7. Click Save.
Restore the default domains
If you want to use your account’s default domains again, click Restore defaults in Edit domains setup.
The domains will revert to the defaults configured in Administration > Account > Domains > Default setup.
For the first-party collector configurations, the paths will also revert to these values:
- Container JS path:
/{{ app_id }}.js - Tracking script path:
/ppms.js - Tracking endpoints path:
/ppms.php

Done.