Own CDN increases cookie lifetime in Safari 16.4 and other browsers using ITP set from “third-party” IP addresses.
The most recent iteration of ITP reduces the lifetime of first-party cookies to 7 days if they are set through a different IP address than your website.
By utilizing your Stape Own CDN, you can route the server GTM tagging URL via the same IP address your site uses. This ensures that the IPs for your sGTM URL and website are identical. As a result, WebKit will not shorten the duration of first-party cookies set via the server-side Google Tag Manager.
Stape Own CDN is available on all plans.
1. Go to your Stape container setting and select Own CDN.
2. Go to CloudFlare and configure CNAME record for the tagging server URL. Please make sure that Proxied is enabled. The setting should look like in the screenshot below.
3. Go to the Rules → Configuration Rules - create a new rule
Scroll down on this page and find the ‘SSL’ feature. Activate it with ‘Full’ option.
4. Go to the Rules → Transform Rules → Modify Request Header - create a new rule
Specify any name you like for the rule
Select ‘Custom filter expression’
Field: hostname
Operator: contains
Value: specify your sGTM subdomain, in our example, it is ‘gtm.stape.tools’
In the modify headers section, specify:
Type: Set static
Header name: X-From-Cdn
Value: cf-stape
Deploy changes
5. Go to the Caching → Cache Rules - create a new rule
Cache eligibility: Bypass cache
Deploy changes.
That's it, now all your requests to and from sGTM will be proxied through Cloudflare.
*If you are using a Web Application Firewall please make sure that it will not block these requests.
Learn how the new Safari ITP limitation of cookie lifetime based on the IP address works, what it means for web advertising and analytics, and how you can deal with it with the help of stape.
Learn how you can use Stape's Cookie Keeper to increase first-party cookie lifetime set by third-party IPs in Safari 16.4 and other browsers using ITP.
A guide on how deal with IP addresses when using Own CDN.