Facebook Integration for Drupal
A few months ago, we added support for Meta Tags on Drupal nodes, which gave you access to add an optional description and list of keywords to news stories, profiles, or other content types on the site. This feature was mainly added because when you link to a page in Facebook their site will try to fetch a description for that link and, if you don’t supply one in the meta description field, it will guess. It’s not very good at guessing.
We’ve now extended this in three important ways:
1. You can now add meta tags to pages.
2. You can add Facebook Open Graph tags.
3. You can add a Facebook “Like” button, which uses the Open Graph tags to give you information about the people visiting and sharing your site.
Adding Open Graph tags
1. Log in.
2. Click on Settings in the Edit Console.
3. In the middle of the page, expand the Meta Tags section.
4. Enter the appropriate values for the page.
5. Save the page.
Adding a Like Button
1. Log in.
2. Click Add in the Edit Console.
3. Select Facebook Like Button from the list of options.
4. Enter the URL of the page to use for the Like button.
5. Click Save.
Why you would do this
When somebody links to your page in Facebook, or when they click a Like button you have put on the page, Facebook makes a request to our website to see what the page is about. If you don’t have any Open Graph tags on the page, Facebook will try to guess what the page represents, taking its title, description, and often an image from content it finds on the page. Using Open Graph tags, you can help Facebook by removing the guess work.
You’ll also see that there is a tag to add a Facebook Admin ID. You can put a single Facebook user ID in that field, or a comma-separated list of multiple user IDs and those people will be able to use Facebook Insights to get reports on pages shared within your site. You’ll want to read over the documentation on Facebook Insights.
Where to add Open Graph tags
You don’t need to add Open Graph tags to every page on your site. You’ll probably want your site’s home page to have them as well as pages that you link to on your own Facebook account or page. For example, it would be good to have the tags on the Economics Department homepage, or a page describing a single event hosted by that department, but not on the distribution requirements page.
Where to add Like Buttons
You probably only need one Like button for your site. Using the Economics Department example above, they could add a Like button to the left column below the site navigation, which will then appear on every page within their site, just like the address information in that area does. But the URL for that button would always be the Economics Department homepage because that’s the value they would enter when creating the button. This way, even if someone is viewing the requirements page and clicks the button, their Facebook feed would still say “[Person] like Economics at Middlebury” with a description, title, and possibly image based off the Open Graph tags set on the department homepage.
Don’t worry if this is a lot of new and confusing information! I’m still trying to figure out how best to use these features on our site. I’ll be putting together a workshop on this topic, but in the meantime if you would like to sit down for a one-on-one meeting to discuss how to best use this in your site I would be happy to schedule that. Just send me an email with a time that is convenient for you (here’s my schedule).