Table of Contents [TOC]

{tocindex article="current"}

Guides

Menu

  • Pricing
  • Features
    • Regulation compliance
    • GDPR (EU)
    • CCPA (California)
    • PIPEDA (Canada)
    • LGPD (Brasil)
    • KVKK (Turkey)
    • POPIA (South Africa)
    • The basics
    • 42 languages
    • User consents recording
    • Third-party cookie blocking
    • Geo targeting
    • Cookie Banner
    • Google Consent Mode v2
    • Automation
    • Automatic monthly scans
    • Automatic script blocking
    • Advanced reporting
    • Cookie Banner sharing
    • IAB TCF 2.3 integration
    • Google-certified CMP
  • Resources
    • Cookie Scanner
    • Privacy Policy Generator
    • CMP Comparison tool
    • System status
    • Roadmap
    • Changelog
  • Blog
    • Guides
    • News
    • GDPR & CCPA
    • Privacy laws
    • Compare
    • Knowledge base
  • Support
    • Help Center
    • Integrations
    • Contact us
    • Feature request
  • For partners
    • Agencies
    • Affiliates
  • separator
  • Language switcher
    • Profile
    • Billing
    • My plan
  • Sign in
  • Try now
 
  • Guides
  • News
  • GDPR & CCPA
  • Privacy laws
  • Compare
  • Knowledge base
Details
24 November 2026

CNAME Tracking Explained: When a First-Party Subdomain Connects to a Third Party

ON THIS PAGE

  • What Is CNAME Tracking and How Does It Work?
    • How does CNAME work?
  • CNAME tracking, Third-Party Cookies and Privacy Risks
  • How to Avoid CNAME Cloaking and Remain GDPR Compliant?
    • 1. Audit DNS records of your website
    • 2. Identify cookies and tracking technologies
    • 3. Inform users of third-party data processing
    • 4. Get consent before non-essential tracking
    • 5. Limit unnecessary tracking and data sharing
    • 6. Apply data minimization and data retention principles
    • 7. Sign a Data Processing Agreement (DPA)
    • 8. Regularly monitor your website
  • Conclusion
  • Frequently Asked Questions

CNAME tracking, also known as CNAME cloaking, allows third-party tracking services to operate through a website's First-party subdomain. To the browser, the requests look First-party, so the vendor gets first-party cookies and avoids third-party tracker blocking.

While CNAME tracking can serve legitimate purposes, both first-party and third-party tracking also create privacy and security issues. Website owners may unintentionally allow third-party services to collect user data under their own domain, even when users do not allow sharing their data with third-party services.

In this article, we'll explain how CNAME tracking works, how it differs from traditional third-party cookie tracking, how to avoid CNAME cloaking risks, and how to comply with GDPR when using it.

What Is CNAME Tracking and How Does It Work?

CNAME tracking is a technique that uses DNS settings to connect a website's first-party subdomain to a third-party tracking service, so a third-party tracker or analytics tool operates under a subdomain of your own website.

Because the subdomain shares your domain name, browsers often treat the connection as first-party rather than third-party. Thus, a third-party provider can receive tracking requests and set first-party cookies through a domain that appears to belong to the visited website.

CNAME stands for Canonical Name. A CNAME record is a type of DNS record that creates an alias from one domain name to another. It is commonly used for legitimate purposes, such as running your own server-side tagging, connecting subdomains to hosting providers, content delivery networks (CDNs), custom email tracking domains, and other external services.

However, CNAME records can also enable user tracking through first-party cookies and other trackers.

Let’s take a website operating at example.com. Normally, when implementing an external analytics provider, tracking requests are sent directly to analytics-provider.com, which browsers can identify as a third-party domain and adequate privacy rules apply.

With CNAME DNS tracking, the website creates a subdomain such as metrics.example.com and forwards a CNAME record to the same analytics-provider.com. But in this case, a user sees the publisher's domain, not the analytics provider’s domain. The user’s browser evaluates the site based on the name in the document and the request URL and treats it as a first-party domain.

The problem is that the browser applies first-party cookie rules, which can violate privacy laws.

How does CNAME work?

CNAME and the CNAME DNS tracking process work as follows:

  1. Subdomain alias
    You create a subdomain, such as analytics.example.com or metrics.example.com, with a CNAME record forwarding to a third-party vendor's domain.
  2. Tracking initiation
    A user visits your website, and the visitor's browser sends a request to metrics.example.com.
  3. DNS resolution
    DNS resolves the target to the third party's servers’ infrastructure, operated by the analytics provider.
  4. First-party tracking
    Because the request uses a subdomain of the visited website, cookies associated with that domain may be treated as first-party cookies and bypass third-party cookie restrictions or ad blockers.
  5. The tracking service collects data
    Depending on its configuration, the provider may collect user information, such as website interactions, identifiers, browsing activity, and other data.

 

This technique is called CNAME cloaking because the third-party infrastructure is effectively hidden behind a first-party domain name.

However, not every CNAME record is used for tracking. It is often used for legitimate purposes. Privacy concerns arise when CNAME records are used to hide tracking services, bypass browser restrictions for third-party trackers, or collect personal data through first-party cookies without appropriate consent.

CNAME tracking, Third-Party Cookies and Privacy Risks

By hiding as a first-party without adequate transparency, tracking through CNAME would be able to hide the real recipient of user data and thus sidestep the third-party tracking requirement that would disclose user data to third parties without the user's consent and would thereby violate privacy laws such as GDPR or the eprivacy Directive.

Let's see the key difference between first-party and Third-Party Cookies.

First-party cookies are placed by the site the user is visiting. Such cookies generally are needed for the essential functions like preserving login sessions, shopping cart data or language preferences. However, first-party cookies are also used for analytics and advertising.

Third-Party Cookies are placed by other websites besides the one a visitor is viewing. These were widely used by advertising networks, analytics providers and other services to track users across multiple sites, analyze users' behavior and deliver targeted ads.

privacy laws, like GDPR in Europe, CCPA/CPRA in the US and many others, have distinct rules for first- and third-party cookies. While first-party cookies are often permitted, third-party cookies are typically blocked by default by most privacy laws. Analytics providers will need prior consent of users to place third-party cookies.

Modern browsers restrict third-party cookies or implement ad blockers against them to limit cross-site tracking. CNAME cloaking would undermine such privacy protections, since external tracking service would be able to track through first-party subdomain, violating data privacy laws.

CNAME cloaking poses several privacy risks.

  • It can become harder to detect tracking
    As an external tracking service would track users through a first-party subdomain, it could become harder to detect that data is being sent to a third party. Although some advanced tracking protection tools can detect CNAME cloaking, some domain-based methods of detecting tracking could miss such requests.
  • Third-party providers may get access to first-party cookie data
    The request to CNAME subdomain may include cookies of the parent website. Thus, the identifiers and other cookie values could be available to an external service. The data would therefore be disclosed to the tracking provider without proper consent.
  • CNAME cloaking could be used to bypass tracking restrictions
    Some tracking providers use first-party subdomains to bypass third-party cookie restrictions. Even if CNAME cloaking does not always bypass modern browser protections, some less complex browsing solutions would not be able to detect some third-party CNAME-cloaked requests.
  • Decrease of transparency
    Users may not be aware of who is collecting their data. They may think that the current website controls the cookies, while in reality a third-party analytics or advertising provider would receive data through a CNAME subdomain.
  • Compliance with GDPR becomes more complicated
    The GDPR and EU's eprivacy rules require websites to comply with transparency, consent and data protection requirements. A third-party cookie does not become exempt from consent requirements as a result of classification as first-party.

 

When CNAME tracking is used for non-essential purposes such as behavioral advertising and certain analytics purposes, websites would need to inform users about use of third-party cookies and obtain prior user consent.

How to Avoid CNAME Cloaking and Remain GDPR Compliant?

CNAME cloaking is not necessarily illegal under GDPR. It is allowed for legitimate purposes. But use of first-party subdomain to place third-party cookies does not relieve you from the obligations related to transparency, personal data processing and Cookie Consent.

French data protection agency, CNIL, specifically addressed CNAME cloaking as an alternative to traditional third-party cookies and noted that such technologies still have to comply with all applicable privacy laws.

To mitigate privacy risks and ensure GDPR compliance while implementing CNAME tracking, you should take the following measures:

1. Audit DNS records of your website

Not all external CNAME connections pose a privacy risk, but you should learn which service providers use CNAME cloaking to identify hidden tracking tools.

To discover CNAME records associated with third-party services, you would need to examine DNS configuration of your website. Pay special attention to subdomains used for analytics, advertising, customer engagement and marketing automation.

Discover which external domains use your subdomains and find out if these services collect user information or place Tracking Cookies.

2. Identify cookies and tracking technologies

Scan your website regularly to discover cookies and other tracking technologies, including those linked to first-party subdomains.

Examine the purpose, the provider, the expiry time and data collected by each cookie.

Since discovering CNAME tracking may not be evident from the domain name of the cookie, use the combination of cookie scanning, DNS examination and browser network inspection.

Such tools as CookieScript's Cookie Scanner would help you discover cookies used on your website and facilitate the process of keeping up-to-date cookie inventory.

3. Inform users of third-party data processing

Your users should know if your website uses third-party analytics services for data processing. The Cookie Policy and Privacy Policy should clearly state how your website collects, processes and stores the users' data and if any data is shared with third parties.

If a third-party tracking provider tracks users through a first-party subdomain, then your users should be aware of the provider, its purposes of data processing and what data is collected by this provider.

Transparency is particularly important in case when data collection is hidden behind CNAME cloaking, so users cannot recognize third-party services from the domain names seen in their browsers.

4. Get consent before non-essential tracking

Under GDPR and other privacy laws, prior consent is required before placing non-essential tracking technologies. This requirement applies to both first-party and third-party domains.

Proper consent process requires a clear cookie notice and Cookie Banner that allows visitors to make an informed decision regarding analytics, advertising and other non-essential cookies.

For instance, if a CNAME-linked subdomain is used for advertising tracking, then the relevant cookies should be blocked until the user consents to this purpose.

5. Limit unnecessary tracking and data sharing

The principle of data minimization (Art. 5(1)(c)) of GDPR requires business to collect, process and store only the minimum personal data that is necessary for the specified purpose.

Examine your tracking service and check if it collects unnecessary data that is not needed for the stated purpose.

If a third-party provider uses CNAME cloaking mainly to bypass privacy protections of browsers and collects user data for advertising purposes, then you should consider discontinuing the integration or switching to a more privacy-friendly provider.

6. Apply data minimization and data retention principles

In case of necessity of using analytics or marketing services, you should apply the principle of data minimization.

Do not send unnecessary Personal Information, restrict access to cookies for unrelated purposes and ensure providers do not process data for unrelated purposes. Anonymize Personally Identifiable Information such as full IP addresses, email hashes and other user identifiers at the server-side endpoint before sending data to downstream vendors. Use IP anonymization to preserve user privacy.

Do not keep user Personal Information longer than it is necessary for the stated purpose.

7. Sign a Data Processing Agreement (DPA)

Examine if a third-party analytics provider transfers data internationally or requires additional safeguards.

In case of international transfer of data, make sure that you have a signed DPA with the third-party analytics or server-side tagging provider and Standard Contractual Clauses (SCCs).

8. Regularly monitor your website

The settings for website tracking can change with time as new marketing and analytics tools and third-party integrations are added.

Periodically audit your DNS records, cookies and network requests to detect unexpected changes.

Also make sure that you use a reliable Consent Management Platform that blocks non-essential trackers before users give consent.

A Consent Management Platform (CMP) such as CookieScript, can help websites maintain cookie transparency even when using CNAME cloaking, collect and manage Cookie Consent preferences, block third-party tracking tools before consent, and store user consent for proof of compliance.

Features particularly relevant to this preparation work include:

  • Cookie Scanner: identifies cookies and other tracking technologies, helping build the tracker inventory needed for the legal review.
  • User consents recording: records visitor choices where consent is required and can support internal documentation.
  • Third-party cookie blocking: helps enforce privacy choices by controlling relevant third-party technologies.
  • Geo targeting: can apply different configurations across jurisdictions. 

 

CookieScript CMP can also provide additional privacy-management capabilities, including:

  • Automatic script blocking
  • Consent events
  • Global privacy regulation support
  • 42 languages
  • Google Consent Mode v2
  • Google Tag Manager integration
  • Automatic monthly scans
  • Advanced reporting
  • Cookie Banner sharing
  • IAB TCF 2.3 integration
  • Privacy Policy Generator

CookieScript is a Consent Management Platform (CMP) that Google includes among the CMP partners available for Consent Mode setup. It is also a Google-certified CMP with Gold tier status.

A 14-day free trial of the Plus plan is available without requiring a credit card.

Conclusion

CNAME tracking shows how the line between first-party and third-party tracking can blur when external services operate through a website's own subdomains.

Although CNAME records are a legitimate DNS feature, CNAME cloaking can create privacy risks, reduce transparency, and complicate compliance with data protection regulations.

For website owners, the key is to understand which services receive user data, what data they collect, identify potentially hidden tracking technologies, and ensure that these tracking technologies respect users' consent choices.

Frequently Asked Questions

What is CNAME tracking?

The practice of CNAME tracking implies the connection between a website's first-party subdomain and a third-party tracking service using DNS settings to run third-party trackers or analytics tools under a subdomain of your website. So, a third-party service provider gets tracking requests from visitors and sets the first-party cookies through a domain which belongs to the website they visit, potentially breaking the data protection laws.

What is CNAME cloaking?

CNAME cloaking, also called CNAME tracking, is a technique that uses DNS settings to connect a website's first-party subdomain to a third-party tracking service, so a third-party tracker or analytics tool operates under a subdomain of your own website. So, to the browser all these requests will appear to be first-party requests, and the vendor will get first-party cookies and avoid third-party trackers blocking.

How to detect CNAME tracking?

To detect CNAME tracking you should check the DNS records of your website to find out any first-party subdomains which are connected to third-party tracking services. For this purpose, you may use DNS lookup tools, browser developer tools, or privacy extension. Perform cookie scans regularly with the help of CookieScript Cookie Scanner to identify tracking cookies.

How to prevent CNAME cloaking?

To prevent CNAME cloaking you should audit your website's DNS records regularly and delete any unnecessary CNAME connections to third-party tracking services. Use privacy focused analytics tools and Consent Management Platform (CMP) such as CookieScript to block any unnecessary trackers until the user gives his or her consent. Scan your website regularly for tracking cookies.

Is CNAME tracking GDPR compliant?

According to GDPR, websites may use CNAME tracking for any legit purposes, but it should be done in accordance with the cookie consent and data privacy policies of GDPR. Websites using CNAME tracking should inform users about data collecting, should disclose information about using third-party tools and should get prior consent for non-essential tracking. For this purpose, a Consent Management Platform such as CookieScript may be used. 

Free comparison tool

Compare CMP prices and features side by side

Pick up to 4 consent platforms, set your number of websites and see yearly prices, pageview limits and features in one view.

  • Yearly prices for 1 to 200 domains
  • Pageview limits and extra fees
  • Features and customer reviews
Compare CMPs Free, no sign-up
 
  • About CookieScript
  • Terms of Service
  • Privacy Policy
  • Pricing
  • Resources
  • Cookie Scanner
  • Privacy Policy Generator
  • System status
  • Sitemap
  • Changelog
  • Alternatives
  • Compare CMPs
  • CookieBot
  • Termly
  • OneTrust
  • Iubenda
  • Cookie Information
  • CookieFirst
  • Illow
  • Blog
  • Guides
  • News
  • GDPR & CCPA
  • Privacy laws
  • Knowledge base
  • Support
  • Help center
  • Contact us
  • Integrations
  • Request a feature
  • Roadmap
  • For Partners
  • For agencies
  • For Affiliates

Copyright ©2026 CookieScript


main version