What Are First-Party Cookies?
Definition
First-party cookies are set directly by the website domain you are visiting. When you browse example.com, any cookies set by example.com or its subdomains (www.example.com, shop.example.com) are first-party cookies.
Common Purposes
First-party cookies typically serve essential website functions:
Session Management:
- Login authentication and user sessions
- Shopping cart contents across pages
- Form data persistence during multi-step processes
- Language and region preferences
Site Functionality:
- User interface customization
- Accessibility settings
- Layout preferences
- Volume controls for media players
Analytics (First-Party):
- Understanding user behavior on your own site
- Tracking navigation paths
- Measuring conversion funnels
- Performance monitoring
Technical Characteristics
Set-Cookie: session_id=abc123; Domain=example.com; Path=/; Secure; HttpOnly
Key attributes:
Domain: Matches the current website domainPath: Typically/for site-wide accessSecure: Transmitted only over HTTPSHttpOnly: Not accessible via JavaScript (security)
Privacy Implications
First-party cookies generally have lower privacy risks:
β Limited tracking scope: Data stays within single website β Clear ownership: Website owner controls the data β User expectations: Visitors expect functional cookies β Easier consent: Some categories exempt from consent requirements
What Are Third-Party Cookies?
Definition
Third-party cookies are set by domains different from the website you're visiting. When browsing example.com, any cookies set by analytics.com, ads.com, or other external domains are third-party cookies.
Common Sources and Purposes
Advertising Networks:
- Google Ads (
doubleclick.net) - Facebook Pixel (
facebook.com) - Programmatic ad platforms
- Retargeting and remarketing
Analytics Platforms:
- Google Analytics (when loaded from Google's domain)
- Adobe Analytics
- Third-party analytics providers
Social Media Widgets:
- Facebook Like buttons
- Twitter/X embedded feeds
- LinkedIn share buttons
- Social login integrations
Content Delivery:
- Video players (YouTube embeds)
- Embedded maps (Google Maps)
- Chat widgets (Intercom, Drift)
- Comment systems (Disqus)
Technical Characteristics
Set-Cookie: tracking_id=xyz789; Domain=.ads.com; Path=/; Secure
Key distinguishing features:
Domain: External domain (not matching current site)- Set by embedded scripts, iframes, or pixel requests
- Persists across multiple websites
- Enables cross-site tracking
Privacy Implications
Third-party cookies pose higher privacy risks:
β οΈ Cross-site tracking: Follow users across different websites β οΈ Behavioral profiling: Build detailed user profiles over time β οΈ Data aggregation: Combine data from multiple sources β οΈ Unknown processing: User doesn't control third-party practices β οΈ Hidden tracking: Often invisible to users
GDPR Treatment: Key Differences
Consent Requirements
First-Party Cookies:
Under GDPR and ePrivacy Directive, consent requirements depend on purpose:
Strictly Necessary (Exempt from Consent):
- Authentication and session management
- Shopping cart functionality
- Security features
- Load balancing
- Fraud prevention
Non-Essential (Require Consent):
- Marketing and analytics cookies
- Personalization beyond basic functionality
- Performance optimization cookies
- A/B testing cookies
Key Point: First-party cookies serving essential functions are exempt from consent requirements, but non-essential first-party cookies (analytics, marketing) require consent just like third-party cookies.
Third-Party Cookies:
GDPR mandates that websites cannot store third-party cookies without explicit user consent:
- β No pre-loading before consent
- β Must obtain opt-in consent
- β Requires granular consent options
- β Easy consent withdrawal
Exception: Strictly necessary third-party cookies (rare, e.g., fraud prevention services essential for site operation) may be exempt, but the bar is very high.
Legal Basis
First-Party Cookies:
Can potentially rely on multiple legal bases:
- Legitimate Interest: For analytics and performance cookies (requires Legitimate Interest Assessment)
- Contract: Session cookies necessary for service delivery
- Consent: Marketing and personalization cookies
- Legal Obligation: Cookies required by law (rare)
Third-Party Cookies:
Typically require consent as primary legal basis:
- Legitimate interest generally insufficient for third-party tracking
- Data sharing with external parties requires explicit user agreement
- Cross-site tracking incompatible with user expectations
- High privacy risk level necessitates active consent
2025 GDPR Requirements
First-Party Cookie Banners Should:
β Distinguish necessary from non-necessary cookies β Allow granular consent for analytics/marketing β Clearly explain purposes β Provide easy consent withdrawal β Not load non-essential cookies before consent
Third-Party Cookie Banners Must:
β Explicitly identify third-party services β Explain data sharing and purposes β List third-party recipients by name β Provide granular opt-in/opt-out β Equal prominence for accept/reject β Link to third-party privacy policies
Transparency Requirements
First-Party Cookie Disclosure:
Privacy policies must explain:
- What first-party cookies you set
- Purposes for each cookie type
- Retention periods
- How users can manage/delete cookies
Third-Party Cookie Disclosure:
Privacy policies must additionally include:
- Identity of each third-party service
- What data is shared with third parties
- Third parties' purposes for processing
- Links to third-party privacy policies
- Information about cross-site tracking
- Users' rights regarding third-party data
Practical Examples
First-Party Cookie Scenario
// example.com sets first-party authentication cookie
document.cookie = "user_session=abc123; Domain=.example.com; Secure; HttpOnly; SameSite=Strict";
// First-party analytics (cookieless or privacy-focused)
// Matomo self-hosted on example.com subdomain
analytics.example.com
GDPR Considerations:
- Session cookie: Strictly necessary, no consent required
- Analytics: Requires consent or valid legitimate interest assessment
- All data processing happens on example.com infrastructure
- User maintains control over their data
Third-Party Cookie Scenario
<!-- example.com loads Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<!-- Sets cookies from google.com domain -->
<!-- Cookies: _ga, _gid, _gat -->
<!-- Facebook Pixel -->
<script>
!function(f,b,e,v,n,t,s)
{/* Facebook tracking code */}
</script>
<!-- Sets cookies from facebook.com domain -->
GDPR Considerations:
- Google Analytics and Facebook Pixel are third-party services
- Cookies set from external domains
- Data shared with Google and Facebook
- Enables cross-site tracking
- Requires explicit opt-in consent before loading
- Must disclose data sharing in privacy policy
Privacy Risks: First-Party vs Third-Party
First-Party Cookie Risks (Lower)
Limited Tracking Scope:
- Data collection confined to single website
- No cross-site user profiling
- Direct relationship between user and website
Clearer Purpose:
- Users visit website intentionally
- Cookie purposes tied to website functionality
- More predictable data usage
Easier to Manage:
- Users can clear cookies per-site
- Browser tools provide visibility
- Direct relationship with data controller
Third-Party Cookie Risks (Higher)
Pervasive Tracking:
- Follow users across hundreds of websites
- Build comprehensive behavioral profiles
- Track browsing history and interests
- Identify users across devices
Opaque Data Processing:
- Users unaware of third-party presence
- Complex data sharing arrangements
- Data used for purposes beyond original site
- Potential data sales to additional parties
Limited User Control:
- Difficult to identify all third parties
- Unclear what data is collected
- Hard to exercise privacy rights across multiple controllers
- No direct relationship with third-party
Browser Evolution and Third-Party Cookie Deprecation
Industry Changes (2025)
Major browsers are phasing out third-party cookies:
Safari (Apple):
- Intelligent Tracking Prevention (ITP) since 2017
- Blocks most third-party cookies by default
- 24-hour cap on first-party cookies set via JavaScript
Firefox (Mozilla):
- Enhanced Tracking Protection (ETP) since 2019
- Blocks known trackers and third-party cookies
- Total Cookie Protection in strict mode
Chrome (Google):
- Third-party cookie deprecation delayed to 2025
- Privacy Sandbox as cookie alternative
- Gradual rollout to 100% of users
Impact on GDPR:
While browser-level blocking reduces third-party tracking, GDPR compliance still requires:
- Consent for any tracking that does occur
- Disclosure of all data processing
- Compliance with alternative tracking methods (fingerprinting, server-side tracking)
- Proper handling of first-party cookies set for third-party purposes
First-Party Cookies for Third-Party Purposes
The Gray Area
Some implementations use first-party cookies to serve third-party purposes:
Server-Side Tag Management:
// Appears as first-party request to example.com
// But data forwarded to Google Analytics server-side
POST https://example.com/analytics
// Backend forwards to Google Analytics
CNAME Cloaking:
// Third-party analytics disguised as subdomain
analytics.example.com β CNAME β external-analytics.com
GDPR Position:
These techniques do not bypass GDPR requirements:
- Purpose matters more than technical implementation
- Data sharing with third parties still requires consent
- Circumventing browser protections may violate user expectations
- Regulatory guidance treats these as third-party tracking
- Transparency requirements apply regardless of technical method
Compliance Best Practices
For First-Party Cookies
- Categorize properly: Distinguish strictly necessary from non-essential
- Minimize scope: Only set cookies actually needed
- Clear purposes: Document why each cookie exists
- Appropriate duration: Set shortest reasonable expiration
- Secure attributes: Use Secure, HttpOnly, SameSite flags
- Respect DNT: Consider Do Not Track signals
- Consent for non-essential: Don't assume legitimate interest applies
For Third-Party Cookies
- Explicit consent: Never load before user opt-in
- Granular control: Allow per-service consent decisions
- Clear disclosure: Name each third-party service
- Privacy policy details: Comprehensive third-party section
- Data processing agreements: Ensure contracts in place
- Regular audits: Monitor what third parties are actually loading
- Consider alternatives: Evaluate if third-party services are necessary
Cookie Consent Implementation
Recommended Approach:
// Only load third-party services after consent
function onConsentGranted(categories) {
if (categories.includes('analytics')) {
loadGoogleAnalytics();
}
if (categories.includes('marketing')) {
loadFacebookPixel();
loadGoogleAds();
}
}
// Strictly necessary first-party cookies (no consent needed)
function setSessionCookie() {
document.cookie = "session=xyz; Secure; HttpOnly; SameSite=Strict";
}
// Non-essential first-party cookies (require consent)
function onAnalyticsConsent() {
document.cookie = "analytics_preference=enabled; Secure; SameSite=Lax";
}
Enforcement and Penalties
Recent Actions (2025)
Regulators increasingly target cookie consent violations:
Common Violations:
- Pre-loading third-party cookies before consent
- Bundling consent (forcing users to accept all or nothing)
- No reject option on first layer
- Hidden or unclear cookie information
- Continuing to track after consent withdrawal
Fine Examples:
- Google/Facebook: β¬90 million (French DPA) for non-compliant cookie consent
- Amazon: β¬746 million for tracking without valid legal basis
- Real-time bidding platforms: Multiple fines for third-party data sharing
Enforcement Priorities:
- Third-party tracking and advertising cookies
- Cross-border data transfers via cookies
- Lack of granular consent options
- Deceptive consent banner designs
Conclusion
First-party and third-party cookies differ fundamentally in origin, purpose, and privacy implications under GDPR:
First-Party Cookies:
- Set by the website you're visiting
- Typically serve site functionality and user preferences
- Lower privacy risk (single-site scope)
- Some categories exempt from consent (strictly necessary)
- Can rely on various legal bases depending on purpose
Third-Party Cookies:
- Set by external domains
- Enable cross-site tracking and behavioral profiling
- Higher privacy risk (pervasive tracking)
- Almost always require explicit opt-in consent
- Subject to stricter transparency requirements
In 2025, GDPR enforcement focuses heavily on cookie consent compliance, particularly for third-party tracking cookies. Organizations must implement proper consent management systems that:
- Distinguish between first-party and third-party cookies
- Categorize cookies by purpose and necessity
- Obtain granular, explicit consent before loading non-essential cookies
- Provide clear transparency about third-party data sharing
- Enable easy consent withdrawal
Our GDPR Checker tool helps identify first-party and third-party cookies on your website, assess consent implementation, and understand your compliance status with current GDPR requirements.