Facebook Share Button

Facebook Share Button

Facebook Share Button is a Meta social plugin that lets visitors share web content to their Facebook feed. Scripts load the Meta SDK and set cross-site tracking cookies on page load, enabling Meta to track visits and attribute browsing behavior for advertising purposes.

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.js script is fetched from connect.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.com to render the Share Button iframe
  • A request to www.facebook.com/plugins/share_button.php loads the button UI and may retrieve the current share count for the page
  • The iframe hosted on facebook.com has 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.com browser identification cookie. Lifespan: 2 years.
  • fr.facebook.com advertising delivery and measurement cookie. Lifespan: 90 days.
  • sb.facebook.com browser 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.

Visit website

Consent Categories

Marketing
Functional

Also Known As

facebook share buttonmeta share pluginfacebook social pluginshare button cookiesmeta tracking consentfacebook widget

Industries

Computers Electronics and TechnologySocial Networks and Online Communities

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

Facebook Login
Facebook Login
Facebook Login is a Meta OAuth authentication service that allows users to sign in to third-party websites using their Facebook account. Scripts load the Meta SDK, set cross-site session cookies for authentication, and may share login activity data with Meta.
Instagram
Instagram
Instagram tracking scripts support conversion measurement for Meta advertising campaigns running on Instagram. Scripts fire on advertiser websites to capture click-through and view-through conversions from Instagram ad placements. Collected data flows into Meta Ads Manager for attribution reporting and audience building.
Meta Pixel
Meta Pixel
Meta Pixel (formerly Facebook Pixel) is a conversion tracking and audience-building tool used by advertisers running campaigns on Facebook and Instagram. Scripts fire events on advertiser websites when users complete actions like purchases or form submissions. Collected data is used for ad targeting, retargeting, and conversion attribution.
Facebook Comments
Facebook Comments
Facebook Comments is a Meta social plugin that embeds a comment system on external websites. Scripts load the Meta SDK, set Facebook tracking cookies on page load, and send engagement data to Meta regardless of whether visitors interact with the widget.
Facebook Like Button
Facebook Like Button
Facebook Like Button is a Meta social plugin that embeds a like and react button on external websites. Scripts load the Meta SDK and set Facebook tracking cookies on page load regardless of visitor interaction. Browsing data may be shared with Meta for ad targeting purposes.
Instagram Feed
Instagram Feed
Instagram Feed embeds allow websites to display Instagram posts and media galleries. Scripts load Meta's Instagram embed code, set tracking cookies, and send interaction data to Meta. Visitor browser data may be shared with Meta on page load regardless of whether visitors interact with the content.

Related Vendors

Google Ads
Google Ads
Google Ads is Google's advertising platform for search, display, and remarketing campaigns. Conversion tracking scripts fire on advertiser landing pages to measure actions taken after ad clicks. The remarketing tag builds audience lists for retargeting users across Google's ad network.
Google
Google
Google is the dominant provider of web analytics, advertising, and infrastructure tools. Scripts like Google Analytics, Tag Manager, Ads, and reCAPTCHA collect behavioral data, manage tag firing, serve targeted ads, and detect bots. Sets persistent cookies to track users and correlate activity across sites.
Microsoft Dynamics 365
Microsoft Dynamics 365
Microsoft Dynamics 365 is a suite of CRM and ERP applications that integrates with websites through tracking scripts and embedded forms. Web tracking code captures visitor behavior, page views, and form submissions to build customer profiles and score leads. Sets cookies to identify returning visitors and attribute marketing touchpoints across sessions.
Microsoft
Microsoft
Runs Clarity (session recording and heatmaps), the Microsoft Advertising UET tag (conversion tracking), and Bing's remarketing pixel. Clarity injects a recording script that captures mouse movements, clicks, and rage clicks. The UET tag fires conversion events to tie ad clicks to on-site actions across Microsoft's ad network.
Microsoft Advertising UET Tag
Microsoft Advertising UET Tag
Microsoft Advertising UET Tag is the Universal Event Tracking pixel for Microsoft's ad platform, formerly Bing Ads. The JavaScript tag fires on advertiser websites to track page views, conversions, and custom events for campaign optimization. Sets cookies to identify visitors across sessions and attribute conversions to Microsoft Search and Audience Network ad clicks.
LinkedIn Ads
LinkedIn Ads
LinkedIn Ads is LinkedIn's advertising platform for B2B marketing and professional audience targeting. Conversion tracking scripts and pixels fire on advertiser websites to measure sign-ups, downloads, and purchases driven by LinkedIn ad campaigns. Sets cookies for audience matching, retargeting list building, and cross-device attribution reporting.

Manage consent for Facebook Share Button

ConsentStack automatically detects and manages Facebook Share Button trackers so your site stays compliant with global privacy regulations.