Chapter 15
IN THIS CHAPTER
Using Facebook Social Plugins
Getting Facebook friends’ likes and comments
Connecting with buttons and plug-ins
Facebook offers 11 ways of integrating users’ social activities with your website. These ways — called Facebook Social Plugins — allow you to set up your website so that whenever a reader interacts with your site, such as by leaving a comment on a blog post, a story about that action appears on that person’s Timeline.
Facebook’s Social Plugins can personalize the content that your visitors see, display the names of Facebook friends who have visited the site, or allow visitors to engage with their Facebook friends without having to log in to your website. By integrating these plug-ins with your website, you essentially give your website the capability to engage Facebook users, increase website traffic, increase brand awareness, and even build your Facebook fan base.
In this chapter, you find out about the different Social Plugins available and which ones you can implement to meet your marketing objectives. We show you how to turn your site into a more personalized experience for your users by adding the Like Button plug-in. We also introduce the Share and Comments plug-ins, which let Facebook users share their opinions about your content with their friends. Finally, you find out how to use the Like Embedded Post plug-in to increase engagement with your Facebook Page, and how to use the Send button to allow visitors to send messages to Facebook friends about content from your website.
Social Plugins allow visitors to your website to view content that their Facebook friends have liked, commented on, or shared. If visitors to your site are logged in to their Facebook accounts (most users are always logged in), they can help your website content spread throughout Facebook without ever leaving your site.
Facebook has created a special section within its developer site (at https://developers.facebook.com/docs/plugins
; see Figure 15-1) that explains the Social Plugins, provides tools for generating the code needed to embed each Social Plugin in your site, and showcases superior implementations on real-world websites. The plug-ins are free to use and allow you to add an interactive layer to your site that complements your Facebook marketing strategy. You can use these plug-ins individually or in tandem, extending to your site many of the same features that people have become familiar with inside Facebook.
Deciding which plug-in (or combination of plug-ins) to integrate into your site can be a bit daunting because some of the capabilities overlap. To help you decide which plug-in is right for your needs, here are brief descriptions and examples of each:
Comments: This plug-in gives users the option to add a comment to your website from their Facebook account. They can also share it with their friends on Facebook. The added exposure through the News Feed can provide you a good source of additional traffic (see Figure 15-2).
You do have options to delete or report negative comments, but you have to manage the process manually.
Adding a Social Plugin to your site is as simple as embedding a single line of code in your website’s HTML code, in much the same manner that you add a YouTube video. Most of the sections in the rest of this chapter explain how to generate the code needed to embed most of these plug-ins within your site. After you have the code, follow these general steps to incorporate it into your website:
Note: You must have access to your website’s source files. If you don’t know where these files are located, get your website developer to point you in the right direction.
In most cases, installing another plug-in is just a matter of using a different line (or lines) of code in Step 3. Refer to the Facebook Developers page for each plug-in for the specific code you need.
One great thing about using Social Plugins is that they let you measure how those plug-ins are being used and determine who’s using them. As you can imagine, this data is critical information that can help you with marketing and even product development.
Facebook allows you to use Facebook Insights to see how visitors to your website interact with the Facebook Social Plugins you’ve installed on your website. When a user shares a link to your site on Facebook by using the Like button, for example, that action can be tracked in a Facebook Insights report about your website.
The next few sections show you how to do this.
To access Insights data for your website, you must create a Facebook application. Creating a Facebook application allows you to associate an application ID with each Social Plugin on your site, which enables Facebook to track the ways Facebook users interact with the plug-in. Creating an app gives you the capability to access Insights for each of your plug-ins.
To create an application, follow these steps:
https://developers.facebook.com/apps
and click the Create a New App button on the right side of the page.Enter the requested information, as shown in Figure 15-3:
If you’re creating an application for the first time, you must grant Facebook permission to access your basic information.
Note that by creating an app, you’re agreeing to the Facebook Platform Policy.
Read more about the policy at https://developers.facebook.com/policy
.
On the next screen, enter the captcha as you see it and then click Submit.
A screen opens asking you to select a product.
Click the Set Up button for the Analytics option.
A screen opens, asking you to select a platform (see Figure 15-4).
Next, to allow Facebook to integrate with your app, you follow a four-step process:
Set up the Facebook software developer kit (SDK) for JavaScript.
To do this, you need to include the JavaScript SDK for the app on your web page, right after the opening <body>
tag. The JavaScript code appears in the window after you configure the desired app (see Figure 15-5). Click Next when done.
The goal is to allow Facebook’s platform to collect information about the way people interact with the Social Plugins on your website. Your application ID, then, allows Facebook and your website to talk to each other.
For Logging Web Activity, copy the code you see onscreen to a button click handler (it tells you whether the button is clicked) in the app.
Facebook then asks you launch the app. Click the button where you added the code, thereby logging your first event. Then click Next.
You can now view your Facebook Analytics Dashboard to debug your app by going to https://www.facebook.com/analytics
. Click the name of your app to view your dashboard. Facebook sends you to Activity ⇒ Event Debugging to ensure that your activities are being logged.
The Comments plug-in enables you to add a comments thread to any page on your website that allows visitors who are logged in to Facebook to add comments (see Figure 15-6). Users can choose to have their comments also posted to their Facebook profiles; those comments show up in those users’ News Feeds, viewable by all their friends. By installing this plug-in, you allow users to leave comments and interact with you, and because their friends see that activity, you can drive more traffic back to your website.
A mobile version of this plug-in automatically shows up when a mobile-device user agent is detected.
To add the Comments plug-in to a page on your site, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Web button.The Embedded Comments plug-in lets you display comments on your website that come from your Facebook Page.
To add the Embedded Comments plug-in to your web page, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Embedded Comments link.The Embedded Posts plug-in lets you add specific Facebook posts from your Page or profile to your website.
To generate code for the Embedded Posts plug-in, follow these steps:
https://developers.facebook.com/plugins
and click the Embedded Posts link.Fill in the requested information to customize your plug-in (see Figure 15-8):
You have the option to select the check box if you want to include the parent comment (the entire post).
The Embedded Videos plug-in lets you share your own videos and other public videos from Facebook on your website.
To add the Embedded Videos plug-in to your web page, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Embedded Videos link.URL of Video: Enter the specific URL of the video you want to embed.
Width: Enter the pixel width of the chosen video.
The Like button lets visitors share your website content with their Facebook friends. When the user clicks a Like button on your site, a story appears in his friends’ News Feeds with a link back to your website. This plug-in is a must if you publish regular content on your website.
To integrate Facebook’s Like Button plug-in with your site, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Like Button link.Click Get Code.
If you chose the capability to measure how people are using this plug-in, select your app to the right of the This Script Uses the App ID of Your App text. See the “Integrating Facebook Insights into Your Social Plugins” section, earlier in this chapter, for instructions on creating an app.
Copy the code and paste it into your website at the location where you want the plug-in to appear. If you’re not familiar with how your website works, please get a professional to help you.
The Page Plugin allows you to display on your website any page that appears on Facebook, which can facilitate promotions with other businesses on Facebook.
To add the Page Plugin to your web page, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Page Plugin link.Fill in the requested information to customize your Page Plugin (see Figure 15-11), as follows:
Use the following check boxes to customize the look of the Page to share:
The Quote Plugin lets website visitors highlight any text on your Page and share it with their friends. Users don’t need any special permissions to use a quote from your Page.
To add the Quote Plugin to your web page, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Quote Plugin link.To see how the Quote Plugin works, click the Try the Plugin button (see Figure 15-12) and highlight any part of the sentence displayed (select part of this sentence to see the plug-in in action).
When you highlight some of the text, you see a pop-up that says Share Quote.
The Save button lets website visitors save your products or services to a private list that they can view later and see any updated promotions.
To add the Save button to your web page, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Save Button link.The Send button lets visitors to your website send your content to friends. They can send a link and a short note as a Facebook message, Facebook Group post, or email message. The Share button is different from the Like button, which allows users to share content with their friends by publishing that content to their Timeline.
To add the Send button to your web page, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Send Button link.The Share button lets website visitors add a message to your website content before sharing it on their Timelines, with groups, or with friends in a Facebook message.
To integrate Facebook’s Share Button plug-in into your site, follow these steps:
https://developers.facebook.com/docs/plugins
and click the Share Button link.Click Get Code.
If you chose the capability to measure how people are using this plug-in, choose your app from the drop-down menu titled This Script Uses the App ID of Your App. See “Integrating Facebook Insights into Your Social Plugins,” earlier in this chapter, for instructions on creating an app.