How can we help?

How to choose User Identifier type in Cookie Keeper

Uliana Lesiv
Uliana Lesiv
  • Updated

If you choose the “Other” platform while configuring Cookie Keeper power-up, you will see the different options in the “User Identifier type” field: cookie, local storage, DOM element, JavaScript variable, and Stape User ID.

 

Cookie Keeper.png

 

All these elements are identifiers for the User ID that help restore the cookies of a specific user that was lost due to ITP browser restrictions.

We recommend using Cookie in this field as it is the most reliable method. Just make sure to create a cookie that complies with the requirements we describe below.

You also have alternatives such as Local Storage, DOM Elements, and JavaScript variables. However, Cookie is still preferred.

If you can’t set the user identifier to comply with the requirements in the next section, you can choose Stape User ID. In this case, cookies will be restored based on the user id that Stape generates.

 

Requirements for creating a Cookie as User Identifier type

You'll need a master cookie in place for Cookie Keeper to restore the user's cookies. The ideal approach is as follows:

  1. The cookie should be set from the server response, with the server's IP address differing by no more than the last two octets.
  2. On every page load, the server should set the cookie (let's call it 'user_id', for example) if it doesn't already exist: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie. The user_id should not be changed/updated if already present in the browser. (just extend, it needs to be persistent)
  3. The value of the cookie must be unique for each user. You can use e.g. IP address + timestamp as the cookie's value.
  4. Cookie duration: 400 days.
  5. Cookie domain: .your-domain.com
  6. HTTP only: false (do not set this parameter to true)
  7. Secure: true

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.