> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cometly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up First Party Domain Tracking

> Set up first party domain tracking in Cometly: serve the pixel from your own subdomain so ad blockers and browser limits block fewer events.

**First Party Domain Tracking** lets you serve the Cometly pixel (the tracking script you add to your site) from a subdomain you control instead of `js.comet-serve.com`. You set up first party domain tracking in three steps: turn it on, add two DNS records, then swap the script on your site.

Ad blockers and browser privacy updates are making it harder to rely on third-party scripts for accurate tracking. When the pixel loads from your own domain, fewer visits and conversions go missing, so your reports tie more leads and sales back to the ads that produced them.

## Why this matters

Serving the pixel from your own subdomain gives you:

* Higher data accuracy (fewer blocked events).
* Stronger compliance and trust (events look like they are coming directly from your site).
* Tracking that holds up as browsers continue to limit third-party cookies and scripts.

> [!TIP]
>
> While you set up your first-party domain, keep using the default Cometly script so you do not lose any tracking. Once your domain is validated, replace the script with your first-party version.

## Before you start

* You need access to the DNS settings of your domain.
* Add at least one domain under **Setup** > **Install the Cometly pixel** > **Add domains**. The **First Party Domain Tracking** switch is disabled until you do.
* Pick a subdomain that is not in use. After setup it is dedicated to serving the tracking script and no longer serves its current content.

## Step 1: Turn on First Party Domain Tracking

1. Click **Setup** in the sidebar and open the step **Install the Cometly pixel**.

2. Under **Pixel options**, turn on **First Party Domain Tracking**.

3. Enter the subdomain you want to dedicate to tracking (for example `e.yourdomain.com` or `data.yourdomain.com`).

   * **Do** use a subdomain like `e.yourdomain.com` or `data.yourdomain.com`. A root domain such as `yourdomain.com` is not accepted.
   * **Avoid** subdomains like `t.`, `track.` or `tracking.`, as they may be blocked by ad blockers.
   * The subdomain becomes dedicated to Cometly tracking only.

4. Click **Configure Domain**.

   Cometly now sets up the certificate and the domain, and the domain shows **Setting up...**. This takes less than a minute on average. Click **Check Status** to refresh until the DNS records appear.

## Step 2: Add the required DNS records

After you configure your domain, Cometly generates two **CNAME records** to add at your DNS provider. If they are hidden, click **Show DNS**.

1. **Certificate Validation**: proves ownership of your domain.
2. **Domain Validation**: points your subdomain to Cometly's infrastructure.

Example records:

![The First Party Domain Tracking block with the tracking domain still setting up and its two CNAME records, Certificate Validation marked Pending Validation and Domain Validation marked Pending Certificate, above the Check Status button.](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/guides/tracking/first-party-domain/04.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=ac33a666c7467dee6b8eb28426312250)

Once you have added them, go back to Cometly and click **Check Status**.

* It is normal for **Certificate Validation** to complete first.

* When both show **Validated**, the domain shows **Configured and active** and your first-party pixel script is ready to copy.

## DNS provider setup guides

Open your provider below for instructions:

> [accordion] Cloudflare
>
> 1. Log in to your Cloudflare dashboard.
>
> 2. Select your domain.
>
> 3. Go to **DNS → Records**.
>
> 4. Click **Add Record** and choose **CNAME**.
>
>    * **Name**: Enter the subdomain (in the example below: `m`).
>
>      ![Cloudflare DNS record form with a CNAME for the subdomain pointing to a cloudfront.net target, DNS only](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/guides/tracking/first-party-domain/06.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=564814d64877476ecc84ba1621cb3ba7)
>
>    * **Target**: Enter the value provided by Cometly.
>
>      ![Cloudflare DNS record form with the certificate validation CNAME name and target, DNS only](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/guides/tracking/first-party-domain/07.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=ea7b10c5d5e9f044fc129301ce1eeb97)
>
> 5. Make sure **Proxy Status** is set to **DNS Only** (gray cloud).
>
> 6. Save the record.
>
> 7. Repeat for the **Certificate Validation** CNAME if shown.

> [accordion] GoDaddy
>
> 1. Log in to your GoDaddy account.
>
> 2. Go to **My Products → DNS → Manage DNS**.
>
> 3. Click **Add**.
>
> 4. From the dropdown, select **CNAME**.
>
>    * **Host**: Enter the subdomain (example: `m`).
>    * **Points to**: Enter the CloudFront value from Cometly.
>
> 5. Save.
>
> 6. Add the second **Certificate Validation** CNAME if required.

> [accordion] Google Domains
>
> 1. Log in at Google Domains.
>
> 2. Select your domain and go to **DNS**.
>
> 3. Under **Custom Records**, click **Add**.
>
> 4. Choose **CNAME**.
>
>    * **Host name**: Enter the subdomain (example: `m`).
>    * **Data**: Paste the value from Cometly.
>
> 5. Save.
>
> 6. Repeat for the Certificate Validation record if shown.

> [accordion] Namecheap
>
> 1. Log in to Namecheap.
>
> 2. Go to **Domain List → Manage → Advanced DNS**.
>
> 3. Scroll to **Host Records** and click **Add New Record**.
>
> 4. Select **CNAME Record**.
>
>    * **Host**: Enter the subdomain (example: `m`).
>    * **Value**: Enter the CloudFront URL from Cometly.
>
> 5. Save.
>
> 6. Add the second **Certificate Validation** CNAME as required.

> [accordion] AWS Route 53
>
> 1. Go to your AWS Route 53 console.
>
> 2. Select your hosted zone (your domain).
>
> 3. Click **Create Record**.
>
> 4. Choose **CNAME**.
>
>    * **Record name**: Enter the subdomain (example: `m`).
>    * **Value**: Paste the CloudFront URL.
>
> 5. Save.
>
> 6. Repeat for the Certificate Validation record.

> [accordion] Bluehost
>
> 1. Log in to Bluehost.
>
> 2. Go to **Domains → Zone Editor**.
>
> 3. Click **Add Record**.
>
> 4. Select **CNAME**.
>
>    * **Host Record**: Enter your subdomain (example: `m`).
>    * **Points To**: Paste the CloudFront value.
>
> 5. Save changes.
>
> 6. Repeat for Certificate Validation CNAME.

> [accordion] Squarespace
>
> 1. Log in to your Squarespace dashboard.
>
> 2. Go to **Settings → Domains → DNS Settings**.
>
> 3. Scroll to **Advanced Settings**.
>
> 4. Add a new **CNAME**.
>
>    * **Host**: Enter the subdomain (example: `m`).
>    * **Value**: Paste the CloudFront value from Cometly.
>
> 5. Save.
>
> 6. Add the Certificate Validation CNAME if required.

> [accordion] Wix
>
> 1. Log in to your Wix account.
>
> 2. Go to **Domains → Advanced → DNS**.
>
> 3. Add a new **CNAME** record.
>
>    * **Host Name**: Enter your subdomain (example: `m`).
>    * **Value**: Paste the CloudFront value from Cometly.
>
> 4. Save changes.
>
> 5. Repeat for the Certificate Validation CNAME.

## Step 3: Replace your pixel

Once both records are validated, the script under **Install the pixel** changes to use your subdomain.

Click **Copy Code** and add the script to the `<head>` of your site (or through [Google Tag Manager](https://docs.cometly.com/integrations/pixel/google-tag-manager.md) or the [WordPress plugin](https://docs.cometly.com/integrations/pixel/wordpress.md)). If the default Cometly pixel is already installed, replace it with this first-party script.

## Check it worked

Under **Pixel options**, your tracking domain shows **Configured and active** and both DNS records show **Validated**. The script under **Install the pixel** now loads from your subdomain. Once that script is live on your site, click **Verify** under **Verify your pixel** in the same Setup step and look for **Pixel detected**.

## Troubleshooting

If validation is not completing or something looks stuck, these are the most common fixes:

* **DNS propagation delay**: DNS changes can take up to 24 to 48 hours, though most resolve in under an hour. Check back after some time.
* **Proxy enabled in Cloudflare**: Make sure your CNAME record's **Proxy Status** is set to **DNS Only** (gray cloud). Proxied records (orange cloud) block validation.
* **Incorrect record type**: Make sure you added a **CNAME** record, not an A or TXT record.
* **Extra characters in the DNS entry**: Check for trailing spaces, missing dots or cut-off values in your DNS panel.
* **Certificate validation first**: It is normal for the **Certificate Validation** record to complete before the **Domain Validation** record. Wait until both show **Validated**.
* **Wrong subdomain**: Make sure the record uses the exact subdomain you configured in Cometly. If you set up `m.yourdomain.com`, the CNAME must match it exactly.
* **Certificate validation failed**: If the domain shows **Certificate validation failed**, click **Request New Certificate**. The new certificate has different DNS validation values, so replace your current validation CNAME record with the new values shown. If the message says your domain's CAA records blocked issuance, first add a CAA record with the value `0 issue "amazon.com"` at your DNS provider.
* **Fallback**: If setup takes longer, keep using the default pixel (`js.comet-serve.com`) until validation is complete.

## Disconnect a first-party tracking domain

You can remove your tracking domain from the same place you set it up.

### Before you disconnect

* The tracking domain **stops serving the pixel immediately**.
* The domain is removed from your space.
* You need to **reconfigure DNS records** if you want to use this domain again.
* To prevent data loss, switch your site back to the **default Cometly script** before you disconnect. The confirmation dialog shows that script so you can copy it.

### How to disconnect

1. Go to **Setup** > **Install the Cometly pixel** > **Pixel options**.

2. On your tracking domain, click **Disconnect**.

3. In the **Disconnect tracking domain?** dialog, copy the general tracking script, then click **Disconnect Domain**.

   ![The Disconnect tracking domain? dialog with the warning Replace your pixel before disconnecting, the general tracking script with its Copy button, and the Cancel and Disconnect Domain buttons.](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/guides/tracking/first-party-domain/09.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=68d07ca088db065ac7c42882b80ed3b1)

4. Update your website to use either the general Cometly pixel or a new first-party domain if you are reconfiguring.

While a tracking domain is connected, the **First Party Domain Tracking** switch cannot be turned off. Disconnect the domain first.

Once your site uses the default pixel, it keeps tracking until you connect a new first-party domain.

## Frequently asked questions

### What happens if I don't add the DNS records right away?

Cometly waits up to 72 hours for the **Certificate Validation** record. After that, the domain shows a message that certificate validation timed out. Click **Request New Certificate** and add the new validation values it shows, as described under Troubleshooting above.

### Does my tracking script change before the domain is validated?

No. The script under **Install the pixel** keeps loading from `js.comet-serve.com` until both DNS records are validated. It switches to your subdomain only when the domain shows **Configured and active**, so the default pixel on your site keeps tracking in the meantime.

### What if requesting a new certificate keeps failing?

After several failed attempts, Cometly pauses automatic retries and the domain shows a note asking you to contact support. Reach out to the team and keep the default pixel on your site until the domain is sorted.

## Next steps

* [Install the Cometly pixel and verify it on your site](https://docs.cometly.com/getting-started/install-pixel.md)
* [Track visitors across several domains with cross-domain tracking](https://docs.cometly.com/guides/tracking/cross-domain-tracking.md)
* [Check what the pixel captures with the Pixel Helper](https://docs.cometly.com/guides/tracking/pixel-helper.md)
* [Fix a pixel that Cometly does not detect](https://docs.cometly.com/support/troubleshooting/pixel/base-code-not-detected.md)

Still have questions or need a hand? We're happy to help. Reach our team at [support@cometly.com](mailto:support@cometly.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.