Cookie CAID
Introduction
The CAID cookie: your VIP pass for a top level tracking visitors on your website! 🌐 Powered by Commanders Act, the CAID cookie, is your go-to for identifying and tracing a visitor's journey across different browsing sessions.
Its construction is essential, especially in the context of restrictions imposed by privacy and security policies such as ITP (Intelligent Tracking Prevention).
You must create it yourself, on your own server, only in the case of "First Party" tracking via CNAME or A-Record, but it is not necessary if you use the proxy method (CloudFlare, etc.). In this documentation, you'll find all the information you need to build it.
Ready to elevate your tracking game and conquer the challenges? Dive in, and let's make your On-Premise CAID cookie the superhero of your website! 🚀\
How to setup your cookie CAID?
When creating your CAID's cookie, apply the following requirements:
Cookie name
"CAID" (in uppercase)
Cookie structure recommendation
✔️ Contains 20 random characters
✔️ Preceded by the year the cookie was created

🎉 Available on the entire domain and its sub-domains.\
Lifetime
✔️Cookie's expiry date: 12 months after creation date.
Creation and Deposit
✔️Created by the company server (On-Premise). ✔️Deposited on the main domain and all associated sub-domains. (.mydomain.com)
Code snippets
Here are some examples of snippet code to create your On-Premise CAID cookie
<?php
$cookie_name = "CAID";
$year = date("Y");
$random_numbers = substr(str_shuffle(str_repeat('0123456789', 20)), 0, 20);
$cookie_value = $year . $random_numbers;
$expiration = time() + (12 * 30 * 24 * 60 * 60); // 12 months
$path = "/"; // Available throughout the domain
setcookie($cookie_name, $cookie_value, [
'expires' => $expiration,
'path' => $path,
'httponly' => true // Enhanced security
]);
?>
Last updated
Was this helpful?