- Help Center
- Track Goals
- Social Sharing
-
Getting Started
-
Configuration
- Targeting
- Split URL
- Product Testing
- Full Stack
- Experiment Management
- CSP Configuration
- Experiment Execution
- Reports
- Exit Popups
- GTM Integration
- Troubleshooting
- Performance Optimization
- Event-Triggered Changes
- Holdout Groups
- Split URL Pages
- URL Parameters
- DataLayer
- Menu Configurations
- Traffic Exclusion
- Experiment Scheduling
- Dynamic Element Changes
- Price Targeting
- Experience Scheduling
- Privacy
- Hash Changes
- Async Tracking
- Selective Installation
- CSS Selectors
- Vue.js Integration
- Page Content
- Multipage Split URL
- Organic Traffic
- Visual Editor
- Server-Side Testing
- Traffic Bucketing
- GDPR Warnings
- Statistical Confidence
- Browser Privacy
- Query Parameters
- Embedded Videos
- Tracking Code Execution
- Simultaneous Experiments
- Tags
- Deployments
- Disable Testing
- Locations
- Programmatic Bucketting
- Query Parameter Handling
- Convert Library
- Variation Previews
- Experiment Editing
- Opt-Out Script
- Data Reset
- Body Hiding
- Visit-Specific Variations
- Variation Styling
- Preview Issues
- Variation Editing
- Full-Site Testing
- Blinking Variations
- Cross-Domain Cookies
- Regex Support
- Conversion Tracking
- SPA Testing
- Project Setup
- Cross-Domain Tracking
- Geo-Targeting
- Analytics Tools
- Campaign Tags
- Previewing
- IDs
- Query String Targeting
- Bounce Rate Goals
- Bot Filtering
- Query String Variables
- Custom Audiences
- Redirects
- Baseline
- Tracking Code Location
- Secure Cookies
- AngularJS
- Cloudflare
- Code Installation
-
Track Goals
- Form Tracking
- Cookie Management
- iFrame Click Tracking
- Performance Optimization
- Revenue Tracking
- Interaction Goals
- Form Submissions
- Advanced Goals
- Lazy Loading
- Multi-Conversions
- URL Parameters
- Bounce Rate Goals
- DataLayer Integration
- Scroll Depth
- Social Interactions
- Page Views
- Marketo Forms
- Feature Analysis
- AJAX Forms
- Revenue Tracking via GTM
- Order Outliers
- Cumulative Revenue
- Goal Templates
- Adding Revenue Goals
- JS-Based Goals
- Goal Basics
- Google Analytics Goals
- Social Sharing
- Dynamic Goals
- Typeform Integration
-
Target Visitors
- Geolocation
- Interaction Goals
- Goal-Based Targeting
- Weather Targeting
- Cookie-Based Targeting
- Page Visits
- Audience Management
- Audience Segmentation
- Experiment Targeting
- Advanced Audience Creation
- Audience Templates
- Audience Creation
- Data Layer Integration
- Manual Activation
- JavaScript Conditions
- Device Targeting
- Language Targeting
- IP-Based Exclusion
- Visitor Management
- Page Tagging
- Cookies
-
Troubleshooting
- Google Warnings
- Visual Editor
- HTTPS Content
- Logs
- Support Options
- Bootstrap
- Cookie Blocking
- Change History
- Mobile Debugging
- AdWords
- Bot Exclusion
- Domain Issues
- Cloudflare Issues
- Monitoring
- Cloaking Penalties
- Goal Editor Issues
- Variations
- Snippet Performance
- Changes Not Saved
- Blocked Visual Editor
- Goal Testing
- Visual Editor Browsing
- Experiment Issues
- Installation Verification
- Data Leak Prevention
- Usage Limits
- Experiment Previews
- GA4 Revenue
- Chrome Debugger Logs
- SPA Errors
- Checkout JSON Error
-
Analyze Results
-
Integrations
- Google Analytics
- Cookie Consent Platforms
- Microsoft Clarity
- Plausible
- Marketo
- HubSpot
- Tealium
- Smartlook
- Klaviyo
- Salesforce CRM
- FullStory
- Snowplow Analytics
- Webflow
- GA4 Roles
- Amplitude
- Segment
- React
- BigCommerce
- WooCommerce
- Active Campaign
- Google Tag Manager
- Mixpanel
- Zapier
- Inspectlet
- Crazy Egg
- LanderApp
- Unbounce
- Instapage
- Drupal
- PrestaShop
- Magento
- Roistat
- Piano Analytics
- Heap Analytics
- Kissmetrics
- Mouseflow
- Adobe Analytics
- Clicky
-
Account Management
-
Developers
-
What's New
-
Common Questions
-
Shopify
Add and Track Social Sharing Buttons
THIS ARTICLE WILL HELP YOU:
- Introduction
- Get the Facebook App ID (Optional)
- Install Facebook SDK for Javascript in your Website
- Add Social Button to your Website
- Install Facebook Social Interaction Tracking Code
- Create Convert JS goal
- View Conversions in Convert Report
Introduction
Convert Experiments allows you to add social media elements to your pages such as Facebook "Like" buttons, Twitter "Follow" buttons, and Google "+1" buttons. This guide will show you how to (i) add these elements to your website using the Convert Visual Editor and how to (ii) track these social media elements e.g. "Facebook likes" as a goal.
For sake of simplicity we will use the "Facebook likes" in the steps described below.
Get the Facebook App ID (Optional)
You can also track Facebook social interactions in Convert Experiments, without having the Facebook App ID. However, we recommend to have this App ID before continue to the next steps as it has many advantages beyond social tracking.
- Login to your Facebook account.
- Go to https://developers.facebook.com/apps and then click "Add a new app" button.
- Type the name of your new App and then click on "Create App ID".
- Then you have to fill in several "Settings" (Platform, Website URL, logo, etc.).
- Click on the "App Review" menu and switch the toggle button to Yes to make your app
public.
Now your Facebook App is available to public.
Install Facebook SDK for Javascript in your Website
Once you have your Facebook App ID, you need to install Facebook Javascript SDK in your website, in order to track Facebook Events in Convert Experiments.
- Go to https://developers.facebook.com/docs/plugins/like-button.
- Pick the URL of a website or Facebook Page you want to use with the like button.
- Paste the URL to the code configurator and adjust settings like the width of your like button. Click the Get Code button to generate your like button code.
- You will see code similar to this:
- Follow instructions for step 1 to add the Facebook Javascript SDK to your website.
Add Social Button to your Website
You can skip this step if you already have a social button added to your website.
Go to your experiment and edit it in Visual Editor. Once there, you can create the button in your desired style and retrieve the necessary code from Facebook.
- Select and Element with the Visual Editor
- The menu will open where you have to Edit HTML
- Add the new code from Facebook for the plugin you want your visitors to like:
- Here the Like button has been added:
Install Facebook Social Interaction Tracking Code
Before you track any likes and dislikes in Convert Experiments, you first need to capture them. You can capture these events by using a method called FB.Event.subscribe(). This method is used to subscribe to a Facebook event and to define a callback function.
Add this code in your website and replace the event with what you want. Facebook events are available here. GOAL_ID is the Convert Goal ID from the Javascript goal that you will create in the next step.
<script>
window.fbAsync.Init = function(){
FB.Event.subscribe('edge.create', function(response)
{
window._conv_q = window._conv_q || [];
_conv_q.push(["triggerConversion", "GOAL_ID"]);
}
);
};
</script>
If you are loading the Facebook API asynchronously, this code should live in the window.fbAsyncInit
function as described on the Facebook JavaScript API documentation page. If you are loading the Facebook API synchronously, this code should live somewhere on the page after the Facebook API JavaScript file has been loaded so that we can ensure the FB object is defined.
Create Convert JS goal
You need to create a JS goal. Give it a descriptive name e.g. Facebook Likes and get the goal ID (to replaced the code in previous step):
View Conversions in Convert Report
Once you've added this code to your page and add the goal to your experiment, Convert will begin tracking Like conversions immediately for running experiments.