Overview
The Facebook Share Button is a Meta social plugin that provides a one-click interface for visitors to share a web page's content to their Facebook feed, timeline, or via Messenger. Like all Meta social plugins, it loads the full Facebook JavaScript SDK on every page where it is embedded, establishing a cross-site data collection channel to Meta's advertising infrastructure regardless of whether visitors use the share functionality.
What This Script Does
The Facebook Share Button is implemented by loading Meta's JavaScript SDK from connect.facebook.net/en_US/sdk.js and rendering a share interface through an iframe or the FB.XFBML.parse() method with a <div class="fb-share-button"> element.
Script Loading and Network Requests
On every page load where the Share Button is present — before any visitor interaction:
- The
sdk.jsscript is fetched fromconnect.facebook.net, establishing a connection to Meta's servers - The SDK initializes with the site's Facebook App ID and sends requests to
www.facebook.comto render the Share Button iframe - A request to
www.facebook.com/plugins/share_button.phploads the button UI and may retrieve the current share count for the page - The iframe hosted on
facebook.comhas access to all of the visitor's Facebook cookies
Cookies
The Share Button triggers the same cookie and tracking infrastructure as other Meta social plugins:
_fbp— first-party tracking cookie on the host domain (when Meta Pixel is co-deployed). Unique browser identifier for advertising attribution. Lifespan: 90 days.datr—.facebook.combrowser identification cookie. Lifespan: 2 years.fr—.facebook.comadvertising delivery and measurement cookie. Lifespan: 90 days.sb—.facebook.combrowser identification cookie. Lifespan: 2 years.
For logged-in Facebook users, Meta reads their session cookies through the iframe and associates the page visit with their Facebook identity. For logged-out visitors, the datr cookie still enables cross-site browser identification.
Data Transmitted to Meta
On every page load, Meta receives:
- The full page URL, including query parameters
- The referring URL
- The visitor's IP address, user agent, and viewport dimensions
- Existing Facebook cookies for profile association
- Open Graph metadata from the page (title, description, image) used to populate the share dialog
When a visitor clicks the Share Button, a dialog opens allowing them to add a comment and post the page to their feed. This action transmits additional data including the share content and the visitor's Facebook identity.
Consent & Compliance
The Facebook Share Button is classified under both marketing and functional categories. The sharing functionality is useful to visitors, but the passive data collection on every page load serves Meta's advertising business.
Under GDPR and ePrivacy, the CJEU Fashion ID ruling (C-40/17) establishes that embedding any Meta social plugin makes the website operator a joint data controller with Meta for the data collection that occurs on page load. Consent must be obtained before loading the SDK. The social sharing functionality does not qualify as strictly necessary — it is a convenience feature, not essential to the delivery of the website content.
Under CCPA/CPRA, the passive data transmission to Meta on every page view constitutes "sharing" of personal information for cross-context behavioral advertising. The Share Button must not load for visitors who have opted out of sharing/selling.
Should You Block This Without Consent?
Yes. The Facebook Share Button transmits visitor data to Meta on every page load for advertising purposes, regardless of whether the visitor clicks the button. Under EU law, you are a joint controller with Meta and must obtain consent before loading the connect.facebook.net script. Consider replacing with a simple share link (https://www.facebook.com/sharer/sharer.php?u=URL) that only contacts Meta when the visitor actively clicks it — this avoids loading the SDK and all associated tracking.
Consent Categories
Also Known As
Industries
Frequently Asked Questions
Does the Facebook Share Button require cookie consent?
Yes. The Facebook Share Button is classified under marketing and functional. Like all Meta social plugins, it loads the full SDK on every page view and transmits visitor data to Meta for advertising purposes under the CJEU Fashion ID joint controller standard. Explicit prior consent is required.
What does the Facebook Share Button track?
On every page load, it contacts connect.facebook.net and sends the page URL, referrer, IP address, and Open Graph metadata to Meta. It sets datr (2 years), fr (90 days), and sb (2 years) cookies on facebook.com. For logged-in users, Meta associates the visit with their Facebook identity via the button iframe.
How does ConsentStack handle the Facebook Share Button?
ConsentStack blocks connect.facebook.net until marketing consent is granted. As an alternative, ConsentStack recommends replacing the SDK-based button with a plain share link (facebook.com/sharer/sharer.php?u=URL), which only contacts Meta when the visitor actively clicks — eliminating passive tracking entirely.
Other Facebook Products

Related Vendors
Manage consent for Facebook Share Button
ConsentStack automatically detects and manages Facebook Share Button trackers so your site stays compliant with global privacy regulations.
