25% off Server GTM for 12 months

Claim 25% off
Server GTM Containers

Cookie Keeper Setup

Extend first-party cookies past Safari's 7-day cap with one setup step on your own site.

2 min readUpdated Nov 9, 2026Taglinko docs
Browse documentation

Cookie Keeper restores your chosen marketing cookies from your own server, so they last past Safari's 7-day cap on cookies set by JavaScript, even after Safari deletes them entirely. It is available on paid Server GTM plans. No Google Tag Manager import is needed, just one setup step on your own site.

1. Enable it and pick your cookies

Open your container's Power-Ups tab, turn on Cookie Keeper, and click the platforms you want extended, or add a custom cookie name (up to 20 in total). This generates your endpoint URL. It is shown right there once enabled, and also on the Overview tab under Cookie Keeper endpoint. The URL already has your API key at the end. In the examples below, YOUR_API_KEY is that last part of the URL.

2. Make it reachable from your own domain

The extended cookie has to come from a response your browser sees as your own site, not Taglinko's. A small reverse proxy on your own domain forwards one path to your Cookie Keeper endpoint. Use a Cloudflare Worker or Nginx. It works anywhere.

Cloudflare Worker

export default {
  async fetch(request) {
    const url = new URL(request.url);
    if (!url.pathname.startsWith('/fn-cookie')) {
      return new Response('Not found', { status: 404 });
    }
    return fetch('https://api.taglinko.com/api/v1/cookie-keeper/YOUR_API_KEY', {
      headers: { cookie: request.headers.get('cookie') || '' },
    });
  },
};

Nginx

location /fn-cookie {
  proxy_pass https://api.taglinko.com/api/v1/cookie-keeper/YOUR_API_KEY;
  proxy_ssl_server_name on;
  proxy_set_header Cookie $http_cookie;
}

3. Call it on every page load

Add one line wherever your other tracking scripts load, using whichever URL you set up above:

fetch('/fn-cookie', { credentials: 'include', mode: 'no-cors' });

The response sets the extended cookies as real, first-party HTTP cookies. Nothing to touch again unless you change which cookies to extend.

If the container moves to the Free plan, the endpoint is disabled right away. See Server GTM Power-Ups for the other options, and First-Party Cookies and Why Cookie Lifetime Matters for the background.

Still stuck?

Open a support ticket from your dashboard and include the container name.

Contact support