Facebook SDK
Facebook SDK for JavaScript is loaded from connect.facebook.net and embeds Meta features such as Login with Facebook, Like and Share buttons, comments and the Meta Pixel. It drops first and third party cookies including _fbp, _fbc, fr, datr, c_user and xs, fires Pixel events and forwards browsing data to Meta Platforms Ireland and Meta Platforms Inc in the United States. Under GDPR and the ePrivacy Directive prior, freely given, specific, informed and unambiguous consent is required before the SDK is loaded.
What does Facebook SDK do?
What Facebook SDK does
Facebook SDK for JavaScript is a script library loaded from connect.facebook.net/{locale}/sdk.js that enables websites to embed Meta features. It powers Login with Facebook, Like and Share buttons, embedded posts, comments plugins, Share dialogs and the Meta Pixel. Once initialised through the FB.init() call, the SDK communicates with facebook.com and graph.facebook.com, reads existing Meta cookies and writes new ones in order to identify users, measure conversions and build custom audiences. It is a primary instrument for Meta advertising and is widely deployed alongside the Meta Pixel and the Conversions API.
Cookies and data collected
The SDK writes a first party cookie _fbp containing the Meta Pixel browser identifier and a _fbc cookie capturing click attribution from fbclid query parameters. When the user is logged into Facebook the third party cookies fr, datr, c_user and xs are read or written on the facebook.com domain. The script also sends event payloads including the IP address, user agent, referring URL, page URL, viewport, language and hashed user data when advanced matching is configured. This rich dataset qualifies as personal data under Art 4 GDPR and is used by Meta for cross site tracking and behavioural advertising.
International transfers and Schrems II
For users in the European Economic Area the controller is Meta Platforms Ireland Limited based in Dublin, but the data is mirrored to Meta Platforms Inc in the United States. Transfers rely on the EU US Data Privacy Framework adopted in July 2023 and on Standard Contractual Clauses with supplementary measures. The framework remains contested following the Schrems II ruling, and in 2023 the Irish Data Protection Commission, acting on the EDPB binding decision, fined Meta 1.2 billion euros for unlawful transfers tied to Facebook services. Operators embedding the SDK must therefore document a transfer impact assessment and monitor evolving case law.
Legal basis and consent
The only valid legal basis to deploy Facebook SDK is the explicit consent of the user pursuant to Art 6(1)(a) GDPR and Art 5(3) of the ePrivacy Directive. The script must not load before consent is captured through a compliant Consent Management Platform. The CNIL fined entities a cumulative 60 million euros for cookies dropped via Facebook without consent, and similar enforcement has been delivered by the AEPD in Spain, the Garante in Italy and the BfDI in Germany. Refusal must be as easy as acceptance, and granular control must be offered for advertising purposes.
Risk profile and DPIA
Facebook SDK creates a high risk profile because it combines profiling, large scale processing, systematic monitoring and third country transfers. A Data Protection Impact Assessment is mandatory under Art 35 GDPR. Controllers must document the categories of data processed, the safeguards in place such as Consent Mode v2 and server side hashing, the retention period of cookies and event data and the rights granted to data subjects including objection, erasure and portability.
Compliance roadmap
Operators should integrate Facebook SDK only after consent is granted, document the data flows in their record of processing activities under Art 30 GDPR, update the privacy notice and cookie policy, configure Consent Mode v2 when the Pixel is deployed through Google Tag Manager, prefer server side integration via the Conversions API to limit browser side exposure and review IAB TCF v2.2 signals shared with Meta. Periodic audits of cookies, beacons and outbound requests to facebook.com and graph.facebook.com are recommended.
Facebook SDK and the GDPR
Facebook SDK is classified as “Marketing”. On a site that targets European visitors, it must only load after the visitor consents, and it must be listed in your cookie policy.
- Legal basis
- Art 6(1)(a) GDPR consent
- Risk level
- high
- Applicable regulations
- GDPR, ePrivacy Directive, EU US Data Privacy Framework, Digital Services Act, Digital Markets Act, TTDSG, French CNIL guidelines, LSSI CE, IAB TCF v2.2
Impact assessment (DPIA)
A Data Protection Impact Assessment is required under Art 35 GDPR because Facebook SDK enables systematic monitoring of website visitors, profiling for advertising purposes, large scale processing of behavioural data and transfers to the United States with Schrems II implications. The DPIA must document the necessity and proportionality of embedding Meta scripts, evaluate the risks created by cookies such as _fbp and _fbc combined with Meta server side enrichment via the Conversions API, assess the safeguards offered by the EU US Data Privacy Framework following the 2023 EDPB enforcement against Meta, and define mitigation measures including a compliant Consent Management Platform, Consent Mode v2, IP truncation, server side hashing of personal identifiers and a documented retention policy.
Sample text for your banner
We use the Facebook SDK provided by Meta Platforms Ireland Limited to display Login with Facebook, social plugins and the Meta Pixel. With your consent, cookies such as _fbp, _fbc, fr and datr are stored on your device and information about your visit, including your IP address and the pages you view, is shared with Meta in Ireland and in the United States under the EU US Data Privacy Framework. This data is used for advertising measurement, custom audiences and profiling. You can accept, refuse or withdraw your consent at any time through our cookie preferences.
What Facebook SDK sets and contacts
- Tracking method
- JavaScript SDK loaded from connect.facebook.net, sets first and third party cookies, fires Pixel events, builds custom audiences via Meta Conversions API
- Server location
- Ireland (Meta Platforms Ireland Ltd) for EEA users, USA (Meta Platforms Inc) for non EU users
- Data transferred outside the EU
- Transfers to Meta Platforms Inc in the United States under EU US Data Privacy Framework and Standard Contractual Clauses. Schrems II concerns apply.
Cookies set (6)
| Name | Type | Duration | Purpose |
|---|---|---|---|
| _fbp | first_party | 90 days | Marketing. Facebook Pixel browser identifier used to track visits across sessions and attribute conversions. |
| _fbc | first_party | 90 days | Marketing. Stores the last click attribution identifier from the fbclid URL parameter for ad measurement. |
| fr | third_party | 90 days | Marketing. Used by Meta on facebook.com for ad targeting, frequency capping and personalisation. |
| datr | third_party | 2 years | Security and identification. Identifies the browser to prevent fraudulent activity on Meta services. |
| c_user | third_party | 90 days | Identity. Stores the Facebook user ID when the visitor is logged in. |
| xs | third_party | session | Identity. Stores the Facebook session identifier for authenticated users. |
Third-party domains contacted (5)
connect.facebook.netfacebook.comwww.facebook.comgraph.facebook.comstaticxx.facebook.com
Frequently asked questions about Facebook SDK
Can't find your question? Write to us, we answer fast.
Which cookies does the Facebook SDK set on my site?
The Facebook SDK writes the first party cookie _fbp containing the Meta Pixel browser identifier with a 90 day lifetime and a _fbc cookie that captures click attribution from the fbclid URL parameter. When the visitor is logged into Facebook, the SDK reads or writes the third party cookies fr (90 days, advertising), datr (2 years, security and identification), c_user (90 days, identity) and xs (session, identity) on the facebook.com domain. All these cookies must be classified as non essential and require prior consent.
Is consent required before loading the Facebook SDK?
Yes, consent is strictly required. The SDK loads scripts that drop cookies and forward personal data to Meta for advertising purposes, which is non essential processing under Art 5(3) of the ePrivacy Directive and Art 6(1)(a) GDPR. The script must remain blocked until the user provides freely given, specific, informed and unambiguous consent through a compliant Consent Management Platform. Refusal must be as easy as acceptance and consent must be renewable and withdrawable at any time.
What legal basis applies to Facebook SDK processing?
The only valid legal basis is the explicit consent of the user under Art 6(1)(a) GDPR. Legitimate interest cannot be invoked because the European Data Protection Board confirmed in 2023 that Meta cannot rely on legitimate interest or contract for personalised advertising. Operators must document the consent record, including timestamp, scope and policy version, and be able to demonstrate consent on request from the supervisory authority.
Where is the data transferred and what about Schrems II?
For EEA users the controller is Meta Platforms Ireland Limited in Dublin, however the data is mirrored to Meta Platforms Inc in the United States. Transfers rely on the EU US Data Privacy Framework adopted in July 2023 and Standard Contractual Clauses with supplementary measures. The framework is still challenged in light of the Schrems II ruling, and the Irish DPC fined Meta 1.2 billion euros in 2023 for unlawful transfers tied to Facebook services. A transfer impact assessment is required.
Do I need a DPIA before deploying Facebook SDK?
Yes, a Data Protection Impact Assessment is mandatory under Art 35 GDPR because the processing involves systematic monitoring, profiling, large scale processing and transfers to a third country. The DPIA must describe the data flows, identify the risks to data subjects, evaluate the necessity and proportionality of the processing and define mitigation measures such as a compliant CMP, server side integration via the Conversions API, IP truncation and a documented retention policy.
How do I deploy Facebook SDK in a compliant way?
Deploy the SDK only after consent through a compliant Consent Management Platform that supports IAB TCF v2.2. If the Meta Pixel is deployed through Google Tag Manager, configure Consent Mode v2 with the ad_storage and ad_user_data signals. Prefer server side integration via the Conversions API to reduce browser side exposure, apply IP truncation and server side hashing of personal identifiers, and document everything in the record of processing activities under Art 30 GDPR.
What are the alternatives to the Facebook SDK?
Compliant alternatives include server side integration via the Conversions API without the browser SDK, first party tracking through a privacy oriented analytics platform, contextual advertising solutions that do not rely on personal data, native login through OpenID Connect providers based in the EU and embedded social content via static previews rather than iframes loading facebook.com. Each alternative reduces or eliminates the dependency on Meta cookies and cross border transfers.
How should I update my cookie policy for Facebook SDK?
List every cookie set by the SDK with its name, purpose, duration and category, identify Meta Platforms Ireland Limited and Meta Platforms Inc as joint controller and processor where applicable, mention the transfer mechanism (DPF and SCCs), describe data subject rights including objection and erasure, link to the Meta privacy policy and explain how to withdraw consent. Review the cookie policy at least annually or whenever Meta updates its SDK or data practices.
LinkedIn Insight Tag
LinkedIn Insight Tag is a web analytics platform that provides businesses with actionable insights into website traffic, user behavior, and conversion performance. It offers real-time data collection, customizable dashboards, and advanced reporting to help organizations understand their audience. LinkedIn Insight Tag supports event tracking, funnel analysis, and audience segmentation, enabling data-driven decision making that improves user experience and drives business growth across digital channels.
Klickly
Klickly is a digital marketing technology that helps businesses reach, engage, and convert their target audience online. It provides advanced targeting, campaign management, and performance analytics capabilities. Klickly enables marketers to deliver personalized experiences across channels, optimize campaign ROI, and gain actionable insights into customer behavior. With automation features and data-driven optimization, Klickly empowers marketing teams to achieve measurable growth.
PubGuru
PubGuru is a marketing platform that equips businesses with tools to amplify their digital presence and drive customer acquisition. It supports audience segmentation, campaign automation, and cross-channel engagement. PubGuru provides real-time analytics and reporting dashboards for performance measurement and strategy optimization. By combining data intelligence with marketing execution, PubGuru helps deliver the right message to the right audience at the right time.
Zeus Technology
Zeus Technology is a marketing platform that equips businesses with tools to amplify their digital presence and drive customer acquisition. It supports audience segmentation, campaign automation, and cross-channel engagement. Zeus Technology provides real-time analytics and reporting dashboards for performance measurement and strategy optimization. By combining data intelligence with marketing execution, Zeus Technology helps deliver the right message to the right audience at the right time.
Container Media Group
Container Media Group is a digital marketing technology that helps businesses reach, engage, and convert their target audience online. It provides advanced targeting, campaign management, and performance analytics capabilities. Container Media Group enables marketers to deliver personalized experiences across channels, optimize campaign ROI, and gain actionable insights into customer behavior. With automation features and data-driven optimization, Container Media Group empowers marketing teams to achieve.
Struq
Struq is a digital analytics solution that helps businesses measure and understand their online performance through comprehensive data collection and analysis. It provides visitor tracking, behavioral insights, and conversion metrics across websites and applications. Struq supports custom event tracking, audience segmentation, and automated reporting. With intuitive dashboards and visualization tools, Struq enables informed decisions that improve experience and drive results.
Make your site compliant today.
Free up to 25,000 sessions a month. No credit card, no commitment.