First-Party ID

Create your own first-party cookies

Stop Losing Your Users: The First-Party ID (FPID) Cookie Explained

The Cookie Crisis: How ITP Steals Your Data

Let's face it: the world of web tracking is getting tough. Browsers like Safari are constantly updating their Intelligent Tracking Prevention (ITP), and one of the biggest casualties is the humble third-party cookie. ITP’s strict policies can block or delete third-party cookies, often wiping them out after just seven days.

What does that mean for you? If an anonymous visitor returns to your site after a week, your analytics might treat them as a brand new person. All that valuable, stitched-together data on their behavior? Gone. You lose the ability to maintain a consistent user identity.

This is where the First-Party Identifier (FPID) cookie steps in to save the day.

FPID is a cookie you set on your own domain. Because it’s a first-party cookie, it’s much more resilient to ITP’s restrictions. By implementing FPID, you ensure that your website can recognize the same visitor, even if they return weeks later on a tough browser like Safari. This is crucial for accurate analytics and a solid user profile.

Key Requirements for Max Effectiveness:

For maximum resilience and effectiveness, FPIDs should be set using a server that utilizes a DNS A record (or AAAA for IPv6), rather than a DNS CNAME or JavaScript.The Edge Advantage: Implementing FPID with Workers

While you could generate this cookie using a "Classic" AEM Sites approach (like in a Servlet), the modern, high-performance way is to move it to the edge.

If you’re already using a Bring Your Own CDN setup like Cloudflare Workers, Akamai, or similar services you can implement the FPID generation directly on the edge. This is fast, efficient, and keeps the logic off your origin server.

Quick Technical Checklist for Adobe Users:

If you are using Adobe's Edge Network, there’s one critical requirement: the ID you generate must be formatted according to the UUIDv4 standard.A Peek at the Worker Logic

The worker code is straightforward:

  1. Check for the Cookie: Look at the Cookie header on the incoming request.
  2. Generate or Retrieve: If the FPID cookie is missing, generate a new UUIDv4 value. If it exists, grab the current value.
  3. Set/Extend the Cookie: Set the FPID cookie on the response with a long expiration (e.g., one year) to keep the identifier alive.
// Simplified Worker Logic
if (fpid cookie is NOT present) {
    // Generate a new UUIDv4
    fpidValue = generate_uuidv4();
} else {
    // Extract the existing fpidValue
    fpidValue = extract_from_cookie();
}
// Set or extend the cookie on the response, e.g., for 1 year
response.headers.append('Set-Cookie', 'fpid=...; Expires=...; Path=/; HttpOnly; Secure');

Don’t Skip the Configuration Step

Your FPID cookie is only useful if your platform knows to look for it! If you’re in the Adobe Experience Cloud ecosystem, you must configure the exact name of your FPID cookie in your Data Stream configuration.The Final Test: ECID Rebirth

You’ll know your setup is perfect when you pass the ultimate test:

  1. Verify Initial Setup: Check your cookies. You should see your custom fpid cookie and the Adobe identity cookies (like kndctr*) which represent the Edge (ECID) ID.
  2. Simulate ITP: Delete all your cookies except the fpid cookie.
  3. Refresh: When you refresh the page, the kndctr* (ECID) cookies should reappear.

If they reappear, it means the Adobe WebSDK Edge Network successfully took your provided First Party ID (the FPID) and used it to generate the same persistent ECID proving you’ve successfully beaten the 7-day expiration and are maintaining a consistent user profile.

For more information on implementing FPID with Adobe WebSDK, you can visit the Adobe Experience League's documentation.