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.

Is Facebook Share Button GDPR compliant?

Facebook Share Button typically loads marketing and functional trackers, which are not strictly necessary for your site to work. Under the GDPR and the ePrivacy Directive, non-essential cookies and trackers must stay blocked until a visitor gives clear opt-in consent. So Facebook Share Button can be fully GDPR compliant, but only if your site holds its scripts until consent is granted and lets visitors decline just as easily. Compliance depends on how your site loads Facebook Share Button, not on Facebook Share Button itself.

Visit website

Consent Categories

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

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

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.
Slack
Slack
Slack is a team messaging and collaboration platform. When embedded on websites, Slack widgets load scripts that may set cookies to identify signed-in users and track widget interactions. Most Slack usage is SaaS with minimal direct browser presence on third-party sites.
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.
TikTok
TikTok
TikTok Pixel is the conversion tracking and audience management tool for advertisers running campaigns on TikTok. Scripts fire on advertiser websites to capture standard events like page views, add-to-cart, and purchases. The data drives campaign optimization, lookalike audience creation, and attribution reporting in TikTok Ads Manager.
ConvertFlow
ConvertFlow
ConvertFlow is an on-site conversion optimization platform for building CTAs, quizzes, forms, and personalized funnels. Scripts embed interactive widgets, set cookies for visitor segmentation, and fire conversion events to track funnel performance across campaigns.
TikTok Ads
TikTok Ads
TikTok Ads tracking scripts supplement the TikTok Pixel to enable campaign targeting and attribution on TikTok's advertising platform. Scripts set cookies and collect behavioral signals to match website visitors to TikTok user profiles for audience segmentation and ad measurement.

Manage consent for Facebook Share Button

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