Extend Safari Cookies
from 7 days to 400 days
Safari's ITP wipes tracking cookies after 7 days. With PixelFly Cookie Life Extension, your customers are correctly identified for up to 400 days — no attribution loss.
Why Safari Breaks Your Tracking
Safari has strict rules about how long cookies can live. Most businesses lose 30–40% of their attribution because of this.
Meta Pixel, Google Tag, and any script using document.cookie — all capped at 7 days by Safari ITP.
When users arrive from a URL with ?fbclid= or ?gclid=, Safari reduces the cap to just 24 hours.
Safari is used by ~40% of mobile users worldwide. Every returning visitor after 7 days is seen as a brand-new unknown user.
_fbp cookie set (expires Day 8)
_fbp cookie set → PixelFly extends it to 400 days via HTTP header
Why Standard Setups Still Fail
Since Safari 16.4 (April 2023), even server-set cookies get the 7-day cap if the tracking server has a different IP than your website. Here's the key rule:
Safari's Two Rules for a Long-Life Cookie
Set-Cookie response header — not JavaScript document.cookie104.16.x.x)Same-Origin Proxy
Route PixelFly tracking through a path on your own domain (e.g. store.com/pf/) instead of a subdomain. Same origin = no IP mismatch = full 400 days.
Own CDN (Cloudflare Proxy)
If your website is already behind Cloudflare, route your PixelFly custom subdomain through the same Cloudflare account. Both domains will share the same Cloudflare IP range — Safari sees matching IPs.
Cookie Keeper (WooCommerce)
Safari may still delete _fbp after 7 days. Cookie Keeper remembers the visitor with a master cookie set by your shop PHP, stores the marketing cookies in PixelFly, and restores them on the next visit — also via shop PHP so Safari treats them as first-party.
- PixelFly Dashboard → Container → Edit → enable Cookie Keeper (Way 3) → Save (KV sync).
- WooCommerce → PixelFly → Advanced → enable Cookie Keeper → Save.
- Visit the shop in Safari: after a page view you should see
_pf_mid. After Meta Pixel runs,_fbpis stored. On a later visit with_fbpcleared, it is restored from the shop.
Step-by-Step Setup Guides
Choose the method that matches your website's infrastructure.
Way 2 — Own CDN (Cloudflare Proxy)
Best for: websites already behind Cloudflare
How it works in plain English
Your website (e.g. store.com) is behind Cloudflare, so its public IP is a Cloudflare IP like 104.16.x.x.
If your PixelFly tracking subdomain (t.store.com) is also proxied through the same Cloudflare account, it will also get a Cloudflare IP.
Safari sees matching IPs → treats the cookie as genuinely first-party → allows up to 400 days.
Confirm your website is behind Cloudflare
Go to Cloudflare Dashboard → your domain → DNS. Your root domain (store.com or www) should have the orange cloud icon (Proxied).
Set up your PixelFly custom domain (if not already done)
In PixelFly Dashboard → Container → Settings → Custom Domain, add a subdomain like t.store.com. Copy the CNAME target shown.
Add DNS record with Proxy enabled (orange cloud)
In Cloudflare DNS for your domain, add:
| Type | Name | Target (value) | Proxy |
|---|---|---|---|
| CNAME | t | track.pixelfly.io | 🟠 Proxied |
Enable Cookie Life Extension in PixelFly
Go to PixelFly Dashboard → Container → Settings → Cookie Life Extension and toggle it on. Click Save. That's it — cookies on your tracking responses will now be set with a 400-day max-age.
Verify it works
On your website, open Safari → Developer Tools → Storage → Cookies. After a page view, check the expiry of _fbp and _ga. They should show ~400 days from today, not 7.
store.com and t.store.com using MXToolbox. The first two numbers of both IPs must match (e.g. both show 104.16).
Way 1 — Same-Origin Proxy
Best for: any website (especially if not on Cloudflare)
How it works in plain English
Instead of routing tracking to t.store.com (a subdomain), you create a path on your own website like store.com/pf/.
Since both the website and the tracking path are under the same domain and IP, Safari sees them as identical — no IP check needed. Cookies live the full 400 days.
Option A Via Cloudflare Worker (recommended if on Cloudflare)
Create a Cloudflare Worker with this code
In Cloudflare Dashboard → Workers & Pages → Create Worker, paste this code:
// Cloudflare Worker — PixelFly Same-Origin Proxy
// Deploy this to your domain: store.com/pf/*
export default {
async fetch(request) {
const url = new URL(request.url);
// Only proxy requests under /pf/
if (!url.pathname.startsWith('/pf/')) {
return new Response('Not found', { status: 404 });
}
// Forward to PixelFly, keeping the path after /pf/
const targetPath = url.pathname.replace('/pf', '');
const targetUrl = 'https://track.pixelfly.io' + targetPath + url.search;
const proxyRequest = new Request(targetUrl, {
method: request.method,
headers: request.headers,
body: request.body,
redirect: 'follow',
});
const response = await fetch(proxyRequest);
// Pass response back to browser — including Set-Cookie headers
return new Response(response.body, {
status: response.status,
headers: response.headers,
});
}
};
Add a Route to your domain
In Cloudflare Dashboard → Workers & Pages → your worker → Settings → Triggers → Add Route:
Zone: store.com
Update your GTM tag endpoint
In your PixelFly GTM tag, change the tracking URL from:
https://store.com/pf/e
Enable Cookie Life Extension in PixelFly
Go to PixelFly Dashboard → Container → Settings → Cookie Life Extension and toggle it on.
Option B Via Nginx (if your website runs on a VPS/server)
Add a location block to your Nginx config
In your Nginx site config (usually at /etc/nginx/sites-available/store.com), inside the server block, add:
# PixelFly Same-Origin Proxy
location /pf/ {
proxy_pass https://track.pixelfly.io/;
proxy_ssl_server_name on;
proxy_set_header Host track.pixelfly.io;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Pass Set-Cookie headers from PixelFly back to browser
proxy_pass_header Set-Cookie;
proxy_cookie_domain track.pixelfly.io $host;
}
Reload Nginx
Update GTM tag and enable Cookie Life Extension
Change the tracking URL in GTM to https://store.com/pf/e. Then enable Cookie Life Extension in the PixelFly dashboard.
Cookie Lifetime Comparison
How long user attribution survives — by setup type
| Setup | Chrome / Firefox | Safari (with ITP) | Notes |
|---|---|---|---|
| Meta Pixel only (JS) | 90 days | 7 days / 1 day | 1 day if visitor came via ad click |
| Server-side (CNAME subdomain, no IP match) | 400 days | 7 days | Safari 16.4+ detects IP mismatch |
| Stape Cookie Keeper (restore after deletion) | 400 days | ~90 days Meta / ~13 months GA | Workaround, not a true fix |
| PixelFly + Way 2 (Own CDN / Cloudflare) Recommended | 400 days | 400 days | IP matches via Cloudflare proxy |
| PixelFly + Way 1 (Same-Origin Proxy) Most Reliable | 400 days | 400 days | Same origin — no IP check ever |
400 days is the browser maximum for server-set cookies. Neither PixelFly nor any platform can exceed this.
Frequently Asked Questions
Ready to extend your cookie lifetime?
Enable Cookie Life Extension in your PixelFly dashboard and follow this guide. Takes about 10 minutes for Way 2.