#GTMTips: Prevent SGTM From Setting the FPID Cookie

The FPID cookie is what server-side Google Tag Manager would prefer to use for your Google Analytics 4 tracking.

It’s a cookie set in the HTTP response from the server, and it’s flagged as HttpOnly, which means it’s only accessible by a web server running on the domain on which it was set.

There’s nothing wrong with the technology, and I do recommend that server-side setups toggle it on by default.

However, there might be cases where you want the server-side GA4 client (which handles the incoming GA4 requests) to occasionally not use the FPID cookie. Perhaps it’s because you have a custom consent system in place, or perhaps you want some GA4 measurement IDs to use the regular JavaScript cookies and others to use the FPID.

Read More…

#GTMTips: Cross-Domain Tracking With Server-Side FPID Cookie

The FPID cookie in server-side tagging for Google Tag Manager is an HttpOnly, server-managed ID cookie that’s designed to replace the JavaScript-managed _ga cookie used by Google Analytics 4 and Universal Analytics.

For more details about the cookie itself, check out my previous article on FPID.

In that article, I mentioned one caveat for adopting FPID being the fact that cross-domain tracking will not work.

I mean, how could it? FPID is an HttpOnly cookie, which means it’s not available to JavaScript in the browser. Cross-domain tracking, on the other hand, decorates links dynamically as users click them, which means it needs the cookie to be available via JavaScript so that it could be decorated into the target page URL.

Read More…