Open Tracked/Guides/Extend cookie lifetime using server-side Google tag manager

Extend cookie lifetime using server-side Google tag manager

Cookies set in an HTTP response from your own domain can last longer than script cookies. Add a restore step for Safari and you keep returning visitors recognisable.

5 min read · Updated October 26, 2026

SServer sets cookieSafari and browser limitsCCookie Keeper restores it
In this guide
Key takeaways
  • Browsers cap cookies. Chrome limits any cookie to 400 days. Safari cuts script-set cookies to about 7 days.
  • A cookie set by your server in an HTTP response lasts longer than a script cookie, but Safari can still cap it in some cases.
  • Open Tracked's Cookie Keeper (every plan) keeps cookies on your server and gives them back, up to 400 days for the platforms you choose.

Cookies are how analytics and ad tools recognise a visitor who returns. If the cookie disappears early, the visitor looks new and the sale is attributed to nothing. Extending cookie life is one of the clearest benefits of server-side tracking, but it has limits and traps. This page explains which cookies matter, what the server can do, and how to restore what the browser deletes. For the Safari details read Safari ITP.

The cookies that matter

CookieSet byUsed forTypical default life
_ga and _ga_*Google tag in the browser (JavaScript)GA4 client and session2 years, but capped at 7 days in Safari
FPIDYour server (GA4 client in the server container)First-party GA4 client IDUp to 2 years, set in an HTTP response
_fbpMeta pixel (JavaScript)Meta browser ID90 days, capped in Safari
_fbcMeta pixel, from fbclidMeta click ID90 days
_gcl_au, _gcl_awGoogle Ads tagsAds conversion linking90 days
_ttpTikTok pixelTikTok browser ID13 months

Lifetimes are from the vendors' documentation at the time of writing and can change.

Check your setup

Check your tracking in one pass

This is an example. Run the check on your own site to see where yours stands.

What your server can do

  • Set cookies in an HTTP response. The GA4 client of a server container sets FPID this way, and tags can set others.
  • Refresh cookies on every visit. Each response can extend the expiry, so active visitors stay recognised.
  • Use a first-party subdomain. The cookie belongs to your own domain.

Where the limits bite

SymptomChrome caps cookie life at 400 days
Likely causeIt is a browser rule for any cookie.
FixPlan for 400 days at most, even if you ask for more.
SymptomSafari caps some server-set cookies at 7 days
Likely causeThe tagging subdomain's IP does not match your main site's, so Safari treats it as cross-site.
FixAdd a restore step. See Cookie Keeper below.
SymptomUsers clear cookies or use private mode
Likely causeThe cookie is gone for good.
FixRecognise the visitor by a first-party identifier such as a customer ID when they log in or buy.
The short version

3 things to remember

Scroll and the points stack up.

01

Browsers cap cookies. Chrome limits any cookie to 400 days. Safari cuts script-set cookies to about 7 days.

02

A cookie set by your server in an HTTP response lasts longer than a script cookie, but Safari can still cap it in some cases.

03

Open Tracked's Cookie Keeper (every plan) keeps cookies on your server and gives them back, up to 400 days for the platforms you c

Cookie Keeper keeps the platform cookies on your tagging server under a hash of an identifier, and sets them again when the same visitor returns without them. In Open Tracked:

  1. Turn on the Data Store first. Cookie Keeper keeps the cookies there.
  2. Choose for each platform whether its cookie is Extended (kept up to 400 days) or not.
  3. Choose how the visitor is recognised: a customer ID, a cookie, local storage, a JavaScript variable or a page element, and give its name.
  4. On the Business plan and up, add custom cookies (a name and the days to keep).
  5. Save, press Generate and use the new head code on your site.
  6. Download the GTM files from the Setup Wizard and import them into your web and server containers.
  7. Press Test this power-up.

Verify in GTM Preview: delete the _fbp cookie, reload the page, and the server container sets it again from the Data Store. Cookie Keeper is available on all plans, including Free, with custom cookies from Business.

What to watch

  • Consent. Restoring a cookie is still storing information on the device. Make it conditional on consent.
  • Privacy notice. Say how long you keep identifiers.
  • Data Store size. The store holds 1,000 keys on Free, 50,000 on Pro, 500,000 on Business and 5 million on Enterprise.
0 of 5 done

Terms you will see

HTTP response cookie
A cookie sent by the server with Set-Cookie, as opposed to one written by a script.
First-party cookie
A cookie that belongs to the site you are visiting.
FPID
The first-party client ID cookie set by a server container.
Cookie expiry
The date after which the browser deletes the cookie.
Restore
Setting a deleted cookie again from a copy kept on your server.

A quick test of your own cookies

1

Open your site in Chrome and Safari

Use a normal window.

2

Open the cookie list

In Chrome developer tools, Application, Cookies. In Safari, Develop, Show Web Inspector, Storage.

3

Read the expiry date

Note it for _ga, _fbp and FPID.

4

Come back after eight days

Check which cookies are still there on an iPhone.

For online stores

Orders from your store, back to the ad that earned them

Your store sends the order once. Open Tracked passes it on to each ad platform, cleaned and deduplicated.

Frequently asked questions

How long can a cookie last?

Chrome limits any cookie to 400 days. Safari caps script-set cookies at about 7 days.

Does a server-set cookie last longer?

Usually yes, but Safari can still cap it at 7 days if the server's IP does not match your site's.

What is FPID?

A first-party ID cookie set by the GA4 client in a server container, used instead of the script-set client ID.

What does Cookie Keeper do?

It keeps your platform cookies on your server and restores them for returning visitors, for up to 400 days.

Is it on the free plan?

Yes. Cookie Keeper is on every Open Tracked plan, with custom cookies from the Business plan.

Do I need spreadsheets to read my results?

No. Once tracking is live, the Open Tracked analytics shows spend, revenue, ROAS and profit, and you can ask Ari, the built-in AI assistant, questions about your own numbers in plain words. Ari's allowance depends on your analytics plan.

Is Open Tracked different from Open Track or Open Space Track?

No. Open Tracked is the official name of our server-side tracking platform, and the website is opentracked.io. Many people search for it as Open Track, OpenTrack or Open Space Track. All of them lead to the same product: server-side Google Tag Manager hosting, first-party analytics and a CRM pipeline.

Fix your tracking at the source

Open Tracked hosts your server-side Tag Manager, keeps first-party cookies alive and shows what each ad is really worth.

Open Tracked
Written by

The Open Tracked team

We build Open Tracked: server-side tracking hosting, analytics and the tools around them, for stores that spend on ads. Questions about this guide, or an idea for the next one?

Write to us Read the docs

Was this article helpful?

Comments

Loading comments...

Turn better tracking into better marketing performance

Start free