Stape/Documentation

Cookie Keeper power-up

Updated Mar 28, 2025

Overview

Use Cookie Keeper to prolong the lifetime of your cookies. Without it, browsers with the latest version of Intelligent Tracking Prevention (ITP), such as Safari 16.4+, set cookies to expire after 7 days.

  • Improved customer journey analysis - with your cookies intact, user identification becomes more consistent and reliable, allowing you to tie different actions of a user along their customer journey.
  • Longer attribution windows - by extending cookie lifespans, you gain a more accurate window for attributing conversions over weeks or months, rather than just a few days.
  • More accurate retargeting and personalization - remarketing or retargeting campaigns rely on the ability to identify a user (via cookie ID) who visited a site or performed a certain action. When the cookie lifespan is extended, it’s possible to serve more relevant ads over a longer period.
  • Better cohort analysis and multi-channel attribution - if cookies expire too soon, the cohort data gets fragmented, and your analytics data might fail to connect repeat visits or conversions back to the same user.

1. Log in to your stape.io account.

2. Select your sGTM container on the dashboard.

Select your sGTM container on the dashboard

3. Click Power-ups, then click the Use button next to the Cookie Keeper panel.

  Click Power-ups, then click the Use button 

4. Toggle the Cookie Keeper switch.

 Toggle the Cookie Keeper switch.

5. Select from the Standard cookies list which standard cookies’ lifetime to extend.

The list of standard cookies that Cookie Keeper prolongs:

NameCookieTime
Stape_dcid13 months
stape13 months
Google Analytics _ga13 months
FPID13 months
Google ADsFPAU90 days
FPGCLAW90 days
_gcl_au90 days
FPGCLGB90 days
wbraid90 days
Facebook_fbp90 days
_fbc90 days
TikTok _ttp13 months
ttclid1 month
Affiliates awin_awc400 days
awin_source400 days
rakuten_site_id400 days
rakuten_time_entered400 days
rakuten_ran_mid400 days
rakuten_ran_eaid400 days
rakuten_ran_site_id400 days
outbrain_cid400 days
Klaviyostape_klaviyo_kx400 days
stape_klaviyo_email400 days
Snapchat_scclid90 days
_scid400 days
Linkedinli_fat_id90 days
Microsoft Bing_uetmsclkid 90 days
Pinterest_epik90 days
add:taboola_cid400 days
cje400 days
Google D&V 360FPGCLDC90 days
_gcl_dc90 days

If the cookies you need are not in the standard list, you can configure custom cookies (available for Business, Enterprise, and Custom plans).

First, enter their names. Next, set a custom number of expiration days (for how long you want Stape to keep them), or just leave the field blank and Stape will keep these cookies indefinitely.

Select the cookies

6. Click Save changes in the bottom of the page.

7. Configure the Code & Setup information section:

  • Domain - choose one of the domains linked to your container. 
  • Web GTM ID - paste your web Google Tag Manager ID. Here’s how to find web GTM ID.
  • GA4 ad block bypass - toggle to reduce the impact of ad blockers on the GA4 tracking code. This setting will affect all container domains. After enabling it, be sure to debug both the web and server GTM containers.
  • Same Origin Path - ensures that requests to the server GTM container appear to come from the same domain as the website. Learn more.
  • Platform - the web GTM code differs for each eCommerce platform. Select your platform, or choose "Other" if yours is not on the list.
Configure the Code & Setup information section

If you use Shopify, WordPress, Magento, Wix, PrestaShop, or BigCommerce platform, you’ll need a respective app/plugin/extension developed by Stape to set up Custom Loader.

  1. Download and configure the app/plugin/extension for your platform:
  2. Back on the Custom Loader setup page, once you’ve entered all the Code & Setup information, click the Generate button.
  3. Follow the instructions on the Configuration panel to set up Custom Loader in your app.
Download and configure the app/plugin/extension for your platform

Setup for other platforms

If you select the Other platform, you will be given a JS code to use on your site instead of the standard GTM loader. To configure the code, enter the following extra information:

  • User identifier type - available if the “Generate with Cookie Keeper” option is active (see below). The recommended method of identification is Cookie. For more details, see how to choose a User Identifier.
  • Cookie name - define the name of the first-party cookie to use as a user identifier.

You can click Advanced settings to enter additional information:

  • Data Layer variable name - specify if you use a non-standard ‘dataLayer’; otherwise, leave it empty.
  • Generate with CDN - available only if the selected domain has an active Stape CDN. If enabled, the container will be loaded from a server closer to your site visitors.
  • Use original GTM code - if enabled, gtm.js will not be replaced and your GTM container ID will not be encrypted. With this option enabled, the protection against adblockers will be much lower.
  • Generate with Cookie Keeper - if enabled, the code will also add Cookie Keeper operation along with GTM loading.

6. Click Generate. You will then be given instructions on how to add a Custom Loader to your site (or a JS code if you selected the “Other” platform). 

Instructions on how to add a Custom Loader to your site 

Make the necessary changes on your website (add the code), or in the Stape applications you use.

When adding the Custom Loader to the site, make sure you also remove the standard GTM loader if you have one.

To check if everything works correctly, right-click on any website page → click Inspect → open the Network tab. Then, enter your custom subdomain. 

If everything is correct, you should see the Google Tag Manager request URL and “200 OK” Status Code.

Testing Cookie Keeper
Can’t find what you are looking for?