TRACKING SPECIALIST — BARIS ASA · LONDON
Synctag
Start the check → TRACKING SPECIALIST — BARIS ASA · LONDON

READING ROOM › SYMPTOM FILES › SYM-106

SYMPTOM FILE SYM-106 FILED 20 NOV 2026 · REVISED 20 NOV 2026

Server-side GTM on a custom domain, and Safari still caps the cookies at 7 days: why, and what actually lasts longer.

ALSO FILED AS
  • “server-side GTM custom domain Safari ITP still 7 days”
  • “sGTM first party cookie Safari ITP”
  • “does server-side tagging extend cookie lifetime in Safari”
  • “Safari ITP CNAME server-side GTM subdomain”
  • “Safari ITP IP address server-side GTM”
  • “FPID cookie Safari 7 days”
  • “_ga cookie still expires after 7 days with server-side GTM”
  • “same origin server-side tagging Safari”

Baris Asa, tracking consultant, London · Last checked: 20 November 2026

Not by itself. A custom domain only lets server-side GTM set cookies; it doesn’t make it set them. So Safari visitors who come back after a week still show up as new users, and ad clicks can lose their credit within a day. Safari keeps the 7-day cap in three cases: a script in the page still writes the cookie (GA4 client left on JavaScript Managed), the tracking subdomain is a CNAME to another company’s domain that your main site doesn’t also use, or its IP address fails WebKit’s same-party test. A cookie your server sets in its own response, from your site’s path or a subdomain that passes both DNS checks, lasts longer. The loss is on file as F-401 : here it is the part that survives a server-side build, because the identity cookie is still script-set or cloaked.

If you haven’t built a tagging server and want to know whether Google Tag Gateway does the job, read Tag Gateway doesn’t fix Safari ITP. If you are still deciding whether to build one at all, that is You don’t need server-side tracking. This note is for the store that built it, put it on its own domain, and still sees Safari forget returning buyers.

Is it happening to you?

One check in GA4, no developer needed. Go to Reports, Tech, Tech details, keep Browser as the dimension, and pick the last four weeks. For Safari and for Chrome, divide New users by Active users. If the cap is biting, Safari’s figure sits well above Chrome’s on similar traffic, and stays there week after week. That is a sign, not proof. The checks further down tell you which of the three cases you are in.

Which case are you in?

Your set-up, in plain wordsSafari capWhat to change
The tagging server forwards hits, but a script in the page still writes the GA4 cookie (GA4 client on JavaScript Managed)7 days; 24 hours after some ad clicksSwitch the GA4 client to Server Managed (check 3)
Your tracking subdomain is a CNAME to your hosting provider’s domain7 days, even on cookies the server setsAn A/AAAA record, or a CNAME to a name on your own domain (check 1)
Your tracking subdomain is hosted on a different network from your shop7 days, even on cookies the server setsA same-origin path through your CDN, or an address on the shop’s network (check 2)
A path on your own site (www.yourshop.co.uk/metrics), cookie set by the serverNone in WebKit’s published rulesNothing
A subdomain that passes checks 1 and 2, cookie set by the serverNone in WebKit’s published rulesNothing

The first three rows stack. One set-up can be in two or three of them, and fixing one leaves the cap in place while another applies. “None” means none under WebKit’s rules as published on the date at the top. WebKit says its IP detection is heuristic and may change.

Because “on my domain” isn’t the test. Safari applies three separate rules, and the domain name only matters to one of them.

1. A script wrote it. WebKit deletes all cookies created in JavaScript after 7 days with no user interaction on the site (WebKit: Tracking Prevention). Since ITP 2.1, persistent cookies created through document.cookie get an expiry of at most 7 days (WebKit: ITP 2.1). It caps them at 24 hours on a landing page reached from a domain Safari classifies as a tracker, through a link with a query string or fragment; click IDs are the usual case (WebKit: ITP 2.2). Google lists _ga as a cookie set by GA4’s JavaScript tags, with a 2-year expiry, and notes that Safari limits first-party cookies to 7 days when the user doesn’t return (Google: cookie usage on websites). A tagging server that only forwards hits leaves that cookie where it was. In server-side GTM, the GA4 client keeps using the browser’s _ga ID while its cookie setting is JavaScript Managed. Google’s own course tells you to set it that way until the server is on your domain (Google: configuring the GA4 data stream). If nobody changes it once the domain is live, _ga stays a script cookie.

2. The subdomain is a CNAME to someone else. WebKit caps any cookie set in the HTTP response at 7 days when a first-party subdomain resolves through a CNAME to a different domain, and your main site doesn’t resolve through the same one. Its table: track.yourshop.co.uk pointing at tracker.example is capped; pointing at another name on your own domain is not (WebKit: Tracking Prevention, WebKit: CNAME cloaking defense). Some hosted tagging services ask you to add a CNAME to their domain. Check 1 tells you whether yours is one.

3. The subdomain is on a different network. WebKit also caps response cookies at 7 days when the subdomain’s IP address counts as third party. The rule came with Safari 17 in 2023 and applies in normal browsing as well as Private Browsing. Two addresses are different parties if one is IPv4 and the other IPv6, if two IPv4 addresses share fewer than the first 16 bits, or if two IPv6 addresses share fewer than the first 64 bits (WebKit: Private Browsing 2.0).

WebKit doesn’t say which two addresses it compares. I read it as the tagging host against your site’s, and everything below assumes that. On that reading, an A record pointing straight at a cloud server fixes the CNAME problem and can walk into this one. A shop on a hosted platform answers from the platform’s addresses, and a tagging server in another network is unlikely to share their first 16 bits. IPv6 matters too: if your site answers on IPv6 and the tagging subdomain only has an IPv4 record, a visitor on IPv6 loads an IPv6 page and sends hits to an IPv4 server, which the first criterion calls different parties.

How do I check which case I’m in?

Three checks. If you don’t run your DNS yourself, send this section to whoever does and ask for the output.

  1. Is the subdomain a CNAME? Run dig +short CNAME metrics.yourshop.co.uk (your tagging hostname) and the same for www.yourshop.co.uk, in a terminal or any DNS lookup site. A CNAME on the tagging host to a domain that isn’t yours, and not shared by the main site, is case 2.
  2. Do the addresses match? Run dig +short A and dig +short AAAA for both hostnames. Compare the first two numbers of each IPv4 address: 203.0.113.10 and 203.0.200.4 share them, 203.0.113.10 and 198.51.100.7 don’t. For IPv6, compare the first four groups. Check AAAA too: the main site on IPv6 with no AAAA record on the tagging host is a mismatch.
  3. Who writes the cookie, and how long does it get? In Safari, open Web Inspector, Network, and load a page with the tag on it. Select the request to your tagging host and read its response headers. An identifier cookie in a Set-Cookie header (FPID with a Server Managed GA4 client) was set by the server. If _ga only ever appears under Storage, and in no response header, a script wrote it: case 1. Then open Storage, Cookies, and read the Expires column. WebKit’s rules cap the expiry itself, so a capped cookie should show an expiry about 7 days out (one day after a tracked click) where you set 2 years. The Google tag rewrites _ga as you browse, so I’d expect the date to move forward from your latest page view; that is my reading, not WebKit’s wording. A server-set cookie from a host that passes checks 1 and 2 should show the lifetime you set. That is the pass or fail.

Fix case 1 last. A cookie the server sets from a capped host is still capped.

What actually lasts longer?

In this order.

  1. Serve the tagging server from your own site’s host, or pass both checks. Google lists three placements. Same origin (www.yourshop.co.uk/metrics, through a CDN or load balancer) is its best practice. A subdomain also gives the server full access to server-set cookies. The default run.app address can only set JavaScript cookies (Google: map server-side tagging to a custom domain). With same origin, the hits go to the same host and address as the page, so neither cloaking check has anything to catch. This needs a CDN or proxy in front of your shop that you control, such as Cloudflare; a hosted storefront on its own can’t route a path to another server. Some hosting vendors offer this routing as a built-in option; the idea is the same. If your platform doesn’t allow it, use the subdomain route. If you stay on a subdomain, it needs a non-CNAME record (or a CNAME to your own domain) and addresses that pass check 2 for both IPv4 and IPv6.
  2. Have the server set the identity cookie. Google’s course says the GA4 client can use a server-managed cookie for client identification in first-party contexts (Google: configuring the GA4 data stream). Switch the GA4 client’s cookie setting from JavaScript Managed to Server Managed, and turn on the migration option so returning visitors keep their current ID. Per InfoTrust’s walkthrough (Google’s pages don’t document it), the server then sets FPID, a secure HttpOnly cookie that page scripts can’t read (InfoTrust: server-side client configuration). Without the migration option, expect a jump in new users; that read is in GA4 users or sessions jumped after server-side GTM. The cut-over steps are in Migrating client-side GTM to server-side.
  3. Check the ad click cookies separately. Google’s server-side Ads guide adds a Conversion Linker tag to the server container (Google: server-side Ads set-up), but doesn’t say which cookies it sets. Don’t assume. Land on the site with a test click ID and repeat check 3. Click cookies written only in the page keep the script caps.
  4. Re-run the checks after any hosting change. A CDN move or a new tagging host can put you back in case 2 or 3 without anyone touching GTM.

What won’t come back, whatever you build?

  • Clicks Safari strips before the visit. Apple’s Link Tracking Protection removes tracking parameters from links opened from Messages and Mail and in Safari Private Browsing (Apple Newsroom, June 2023), and in normal browsing when advanced tracking protection is switched on. Safari removes them before the page loads (WebKit: Private Browsing 2.0). WebKit doesn’t publish the list. A parameter that never reaches your server can’t be stored. The campaign-loss side is F-204 .
  • Cookies the visitor deletes, and people who decline consent. A server-set cookie lasts longer. It isn’t a way round the banner. Consent Mode’s modelling fills part of the declined gap; the server-side set-up for it is in Consent Mode v2 with server-side GTM.
  • Other platforms’ browser cookies. A cookie a pixel writes in the page follows rule 1 unless your server sets it too.

How do I know it worked?

Two reads. Straight away: check 3 again, with the Expires column showing the lifetime you set. Over the following weeks: the GA4 check from the top of this note, where Safari’s New users to Active users figure should move towards Chrome’s. Don’t expect the gap to close. Stripped clicks, deleted cookies and declined consent stay out of reach. I have no Google or Apple figure for the size of the gain, and it depends on how much of your traffic is Safari.

If the checks put you in more than one case and nobody on your side owns the DNS and the container, that’s the job I do: DNS, container and the cookie check, filed against F-401. Send the tagging hostname and your shop’s hostname. Checks 1 and 2 are public DNS lookups, so they can be read from here; check 3 needs a browser session on your site.

Common questions

No, not by itself. Google’s custom-domain guide says a custom domain gives the server access to server-set cookies; the default run.app domain can only set JavaScript cookies. Three things still bring the 7-day cap back: a script in the page still writes the cookie, the tagging subdomain is a CNAME to a host outside your site, or its IP address counts as a different party from your site’s in WebKit’s test.

Which cookies does Safari still cap when I use server-side GTM?

Any cookie written by JavaScript in the page: _ga when the GA4 client is left on JavaScript Managed, and click cookies a web-side tag writes. WebKit deletes cookies created in JavaScript after 7 days with no user interaction on the site, and caps them at 24 hours on a landing page reached from a domain it classifies as a tracker, through a link with a query string. Cookies set in a server response escape both rules, unless the response comes from a cloaked third-party CNAME or IP address.

How does Safari decide my tagging server’s IP address is third party?

WebKit’s Private Browsing 2.0 post gives the current heuristic: two addresses are different parties if one is IPv4 and the other IPv6, if two IPv4 addresses share fewer than the first 16 bits, or if two IPv6 addresses share fewer than the first 64 bits. WebKit says the detection is heuristic and may change. A response from a different-party address has its cookies capped at 7 days.

My tagging subdomain is a CNAME to my hosting provider. Is that a problem?

It can be. WebKit caps cookies set in the response at 7 days when a first-party subdomain resolves through a CNAME to a different domain, unless your main site resolves through the same CNAME. A CNAME to another name on your own domain is not capped. Check with a DNS lookup on both hostnames.

A cookie the server sets in its own Set-Cookie response, from a path on your own site (Google’s same-origin option, through your CDN or load balancer) or from a subdomain with no third-party CNAME and an address WebKit treats as the same party. In server-side GTM that means switching the GA4 client’s cookie setting to Server Managed, which sets an HttpOnly FPID cookie from the server. In Safari’s Web Inspector, the cookie’s Expires value should show the lifetime you set, not 7 days.

No. Apple’s Link Tracking Protection removes tracking parameters from links opened from Messages and Mail and in Private Browsing, and in normal browsing when advanced tracking protection is on, before the page loads. WebKit doesn’t publish which parameters. A parameter that never reaches your server can’t be saved in any cookie.

Sources

Read on 20 November 2026:

← back to the reading room