Back to Guides
Setup8 min read

Understanding Cookie Categories

Learn about the four main cookie categories and how to properly classify cookies on your website.

Why Categories Matter

Cookie categorization is essential for GDPR compliance. Users must be able to consent to specific purposes, not just a blanket "accept all." Proper categorization helps users make informed choices about their privacy.

Necessary Cookies

Always Active

Essential for the website to function. These don't require consent as they're strictly necessary. Examples: session cookies, shopping cart, security tokens, consent preferences.

Common Necessary Cookies
Cookie NameVendorPurposeRetention
PHPSESSIDPHPSession managementSession
__stripe_midStripePayment processing1 year
csrf_tokenWebsiteSecurity protectionSession
cookiebeam_consentCookieBeamStores consent preferences1 year

Analytics Cookies

Requires Consent

Used to understand how visitors interact with the website. They collect information about page views, traffic sources, and user behavior. Maps to Google Consent Mode's analytics_storage parameter.

Common Analytics Cookies
Cookie NameVendorPurposeRetention
_gaGoogle AnalyticsDistinguishes users2 years
_ga_*Google Analytics 4Maintains session state2 years
_hjSessionUser_*HotjarUser identification1 year
_clckMicrosoft ClaritySession tracking1 year

Marketing Cookies

Requires Consent

Used for advertising and tracking across websites. Enable retargeting, conversion tracking, and personalized ads. Maps to Google Consent Mode's ad_storage, ad_user_data, and ad_personalization parameters.

Common Marketing Cookies
Cookie NameVendorPurposeRetention
_fbpMeta/FacebookFacebook pixel tracking3 months
_gcl_auGoogle AdsConversion linking3 months
IDEGoogle DoubleClickAd targeting1 year
_tt_*TikTokTikTok pixel tracking1 year

Preference/Functional Cookies

Requires Consent

Enable personalization and enhanced functionality. Remember user preferences like language, region, or UI settings. Maps to Google Consent Mode's functionality_storage parameter.

Category Comparison

AspectNecessaryAnalyticsMarketingPreferences
Consent RequiredNoYesYesYes
Default StateActiveBlockedBlockedBlocked
Can DisableNoYesYesYes
Third-partyRarelyOftenAlwaysSometimes

CookieBeam Auto-Classification

CookieBeam's AI-powered scanner automatically categorizes cookies from over 10,000 known tracking scripts. Just run a scan and we'll classify cookies for you!