First-Party Context (CNAME) for A/B Testing: How to Serve the Varify Script from Your Own Subdomain

·Updated October 2026
Script delivery from your own subdomain
Included in the Enterprise plan
Activation by the Varify team within up to 48 hours
Key Takeaways
  • First-party context means the A/B testing script is loaded from a subdomain of your own website, for example custom.yourdomain.com, through a CNAME record that points to the testing tool.
  • For Varify, the setup has four steps: create a subdomain, point a CNAME record to app.varify.io, ask Varify support to activate it, then switch the script URL and set window.varify.cname = true;.
  • Activation by the Varify team can take up to 48 hours. First-party context (CNAME) is included in the Enterprise plan.
  • With several website domains, the subdomain setup is agreed with Varify support for each installation.

An A/B testing script is usually loaded from the vendor's domain. With first-party context, the same script is loaded from a subdomain of your own website. The technical means is a CNAME record in your DNS: it makes a subdomain such as custom.yourdomain.com an alias for the vendor's address.

This page explains what first-party context changes for an A/B testing script, what it means for websites with several domains, and how to set it up for Varify. The step-by-step setup is also described in the Varify documentation under CNAME.

What first-party context (CNAME) means for an A/B testing script

Browsers distinguish between resources from the site a visitor is on (first party) and resources from other sites (third party). A script loaded from app.vendor.com on www.yourdomain.com is a third-party resource. The same script loaded from custom.yourdomain.com belongs to your own site.

A CNAME record is the DNS entry that makes this possible. It says: the name custom.yourdomain.com is an alias for another address. When the browser requests the script from your subdomain, DNS resolves it to the testing tool's application, which then answers the request.

Varify's documentation describes it like this: "You have the option of defining your own subdomain with a CNAME, which points to the Varify application." The requests that the Varify script makes then go via your subdomain.

Three parties are involved in the setup:

  • Your DNS administrator creates the subdomain and the CNAME record.
  • The vendor activates the subdomain on its side, so that its application answers requests for it.
  • Your web team switches the script URL on the website, or in the tag manager that loads the script.

Effect on performance and blockers

Varify describes the purpose of first-party context on its plans page: "Deliver the Varify script from your own subdomain for better performance and fewer blockers."

For a security or IT review, two questions belong in the setup plan:

  • Cookies on the parent domain. Requests to the subdomain reach the vendor's application. Check which cookies of your parent domain the browser sends to that subdomain, and scope sensitive cookies to the hosts that need them.
  • Content Security Policy. Add the subdomain to script-src and connect-src; the keyword 'self' does not cover other subdomains. The page on Content Security Policy for A/B testing tools explains the other directives.

How much a first-party setup changes the loading behavior on your site depends on your setup, your visitors and their browsers. Measure it on your own pages before and after the switch. For the loading behavior of the script in general, see the page on anti-flicker and A/B testing performance.

Multi-domain setups

Many companies run more than one website domain: country shops such as yourbrand.de and yourbrand.fr, separate brand sites, or a shop and a help center on different domains.

First-party context is tied to the site the visitor is on. A subdomain of yourbrand.de is first-party on yourbrand.de and its subdomains. On yourbrand.fr, it is a resource of another site. If first-party context matters on every domain, each domain needs a subdomain of its own.

For Varify, the subdomain setup is agreed with Varify support for each installation. A fixed rule per domain is not described publicly, so bring your list of domains to the setup conversation. The list should state:

  • every website domain on which experiments will run,
  • which of these domains share one Varify installation, and which have their own,
  • the subdomain you plan to use on each domain,
  • who manages DNS for each domain.

Sites that share one parent domain, for example www.yourbrand.com and shop.yourbrand.com, belong to the same site in the browser's sense. Check with support whether one subdomain covers them in your setup.

How to set it up

The setup follows the Varify documentation article CNAME:

  1. Create a subdomain. Choose a subdomain of your website, for example custom.yourdomain.com.
  2. Create the CNAME record. In your DNS, create a CNAME record for that subdomain that points to app.varify.io.
  3. Ask for activation. Send a message to support@varify.io to activate the new subdomain. "The Varify.io team will activate the subdomain. This process can take up to 48 hours."
  4. Switch the script. Replace the URL app.varify.io in the Varify script on your website with your new subdomain, and add window.varify.cname = true; to the Varify script, so that all requests are sent via your own subdomain.

After the switch, open a page with a running experiment and check in the browser's developer tools that the script and its requests go to your subdomain.

Treat the switch like any other change to a script that runs on your production website. Schedule it for a time when your team can watch it, switch one website or one tag manager container first, and keep the previous script snippet at hand. If several teams maintain pages or containers, tell them about the new script URL before the switch, so that no copy of the old snippet stays in use on a page nobody checked.

Plan: First-party context (CNAME) is included in the Enterprise plan. In the plan comparison it is listed as "CNAME: individual delivery via a freely configurable subdomain". See the plans page.

What stays the same with CNAME

A CNAME changes the address the script is loaded from. It is a DNS setting, and several things around it stay as they are:

  • The contract. Your data processing agreement and its annexes stay unchanged.
  • The plan. First-party context is part of the Enterprise plan.
  • The storage in the browser. For Realtime Tracking, Varify states: "No cookies. Identifiers are kept in first-party localStorage and sessionStorage in the visitor's browser."
Note: This page is not legal advice. It describes a DNS setup. Legal questions about running A/B tests are for your legal team or data protection officer to decide.

For the full security review of an A/B testing tool, including script delivery, see the 25-point security checklist.

Checklist for IT

Use this list to plan and verify a first-party setup:

  • The list of website domains that will run experiments is complete.
  • A subdomain is chosen for each domain where first-party context is required.
  • The subdomain setup per domain is agreed with the vendor's support.
  • Each CNAME record points to the target the vendor names, for Varify app.varify.io.
  • Activation by the vendor is confirmed, and the date is documented.
  • The script URL is switched on every page and in every tag manager container.
  • For Varify, window.varify.cname = true; is set in the script.
  • The CSP lists the new subdomain in script-src and connect-src.
  • The cookies of the parent domain that reach the subdomain are reviewed.
  • The browser's developer tools show the script and its requests on the subdomain.
  • The DNS owner of each record is documented, so that changes go through one team.

Serve Varify from your own subdomain

First-party context (CNAME) is part of the Enterprise plan.

Frequently asked questions about first-party context (CNAME)

Does each domain need its own CNAME?

A subdomain is first-party only on the site it belongs to, so a website on a different domain needs a subdomain of its own for first-party context. For Varify, the subdomain setup is agreed with Varify support for each installation; a fixed rule per domain is not described publicly. Bring your list of domains to the setup conversation.

How long does activation take?

After you create the CNAME record and contact support@varify.io, the Varify team activates the subdomain. This process can take up to 48 hours.

Does CNAME help against ad blockers?

Varify describes the purpose of first-party context as delivering the script from your own subdomain "for better performance and fewer blockers". How a specific blocker behaves depends on the blocker and its filter lists, so measure the effect on your own site.

Which Varify plan includes CNAME?

The Enterprise plan. It includes "CNAME: individual delivery via a freely configurable subdomain". See the plans page.

Do we need a developer for the DNS record?

You need someone with access to your DNS management, which in most companies is IT or the team that runs your domains. Switching the script URL and adding window.varify.cname = true; needs access to your website code or to the tag manager that loads the script.