PixelYourSite Professional / General Settings / Track Domains and Subdomains Together

Track Domains and Subdomains Together

Last updated: June 5, 2026

Where to find it: PixelYourSite Pro → Settings → Other stuff card, the Track domains and subdomains together toggle.

If you run PixelYourSite Pro on more than one subdomain of the same root domain (for example shop.example.com and blog.example.com), turn this on so PYS treats them as one property.

When on, PYS writes its cookies to the root domain (.example.com). The same visitor keeps the same identifiers across every subdomain. When off, each subdomain has its own copy of the cookies and the same visitor looks like a different person on each one.

Leave it off if your site lives on a single host.

How it works — two layers

Cross-subdomain tracking has two independent layers. Most stores want both.

Layer 1 — shared session data (this option)

PYS stores landing page, traffic source, UTM parameters, first-visit attribution, and the pbid browser ID in cookies. With this option on, those cookies live on the root domain and follow the visitor across every subdomain.

Every event PYS fires from any subdomain then carries the same UTMs, landing page, and traffic source. This is true even if each subdomain fires to a different pixel: if shop.example.com sends to Meta Pixel A and blog.example.com sends to Meta Pixel B, both pixels still receive the same utm_source, the same landing_page, the same referrer. The data lives in the cookies, not in the pixel.

For Meta and TikTok, pbid is also sent as external_id for advanced matching — so those two platforms also see the same visitor ID across subdomains.

Layer 2 — same destination (configured per pixel)

Sharing cookies does not change where events are sent. Two subdomains firing to two different Pixel IDs still produce two separate event streams at Meta. They will carry consistent attribution data, but they are still two streams.

To collapse them into one stream at the platform, every subdomain must send events to the same tag ID and API credentials:

  • Meta — same Pixel ID, same Conversions API access token.
  • Google Analytics 4 — same Measurement ID, same Measurement Protocol API secret (if used).
  • Google Ads — same Conversion ID and Conversion Labels.
  • TikTok — same Pixel ID, same Events API access token.
  • Pinterest — same Tag ID, same Conversions API token.
  • Bing — same UET Tag ID.
  • Reddit — same Pixel ID, same Conversions API token.
  • GTM — same container ID.

Combinations

SetupResult
Option ON, same pixel IDs on every subdomainFully unified. One visitor, one journey, one report.
Option ON, different pixel IDs per subdomainEach pixel sees consistent UTMs and attribution for that visitor, but the journey is split across two pixel streams.
Option OFF, same pixel IDsOne destination, but session data resets at each subdomain boundary. UTMs from the first visit don’t follow the visitor.
Option OFF, different pixel IDsNo unification of any kind.

Aim for the first row: turn the option on and use the same tag IDs and tokens across every subdomain.

Cookies it affects

When on, these cookies are scoped to the root domain instead of the current subdomain:

  • pbid — PYS browser identifier. Sent as external_id for Meta and TikTok advanced matching and for the Meta CAPI / TikTok Events API.
  • pys_landing_page — the first URL the visitor arrived on in this session.
  • pysTrafficSource — the referrer captured at session start.
  • pys_first_visit — first-visit attribution used by the WooCommerce and EDD First-Party Reports.
  • UTM cookiesutm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_id.

All of these flow as event parameters to every destination. external_id is consumed by Meta and TikTok; the rest reach every pixel.

How to enable it

  1. Go to PixelYourSite Pro → Settings.
  2. Scroll to the Other stuff card.
  3. Turn on Track domains and subdomains together.
  4. Save changes.
  5. Repeat on every WordPress install on a subdomain of the same root domain. Turning it on in only one install does not help.

Verify it is working

  1. Open one of your subdomains in a fresh incognito window.
  2. In Chrome DevTools, open Application → Cookies and select the current site.
  3. In the Domain column for the pbid cookie, you should see .example.com (with the leading dot), not shop.example.com.
  4. Navigate to a different subdomain in the same browser. The pbid value should be identical.

The same check applies to pys_landing_page, pysTrafficSource, and the UTM cookies.

Visitors who arrived before you turned this on

Existing visitors already have cookies scoped to the subdomain they first hit. The browser sends those old cookies alongside any new root-scoped ones, and PYS can read the wrong one until they expire.

Two options:

  • Wait it out. Old cookies expire on their normal schedule (30 days for landing-page and traffic-source cookies; the pbid cookie expires per the External ID expire days setting under External IDs).
  • Ask returning customers to clear cookies for your domain. The next visit writes the new root-scoped cookies cleanly.

Most stores wait it out. The impact is limited to existing visitors and rarely lasts more than a few weeks.

Edge cases

Custom COOKIE_DOMAIN in wp-config.php. PYS computes the cookie domain from the site URL and ignores the COOKIE_DOMAIN constant. If you set it explicitly, check that PYS and any other plugins agree on the scope.

Different root domains. This option only works across subdomains of the same root. Cookies cannot be shared between example.com and example.net by any browser mechanism.