Business & Finance Social Media

Facebook Share/Like - How to Control What Data Is Shared From Your Site

For web admins and designers, it's important to control what data Facebook pulls from your site when users share your URL through their wall posts, status updates, and like/share buttons.
If you check Facebook's developer pages it explains this quite clearly.
You will need to specify metatags to tell Facebook what data to grab.
Below are the tags they recommend setting in your header so that the proper data is passed to Facebook.
However if your site is properly laid out and configured, Facebook can usually just grab the info it needs without the need for these tags.
I would suggest using the above tags just to ensure the correct data is shared, but typically if these tags are missing it will grab data as follows: Title: It will grab the title from the HTML page title tag Description: From what I can tell, it will grab the first text it finds wrapped in a tag.
Image: It will pull several images and allow the user to select which image to use.
This one almost always pulls the wrong images and you will not be happy with what's posted.
I recommend at least setting this one, but you still don't need to use the above tags.
To tell Facebook which image to use you can use the following: Since your page is missing the og tags above, it will pull the image based on this link tag.
Then to tell it what to use for the description you just use the description meta tag: That's it! The title one is usually always taken care of because I hope you are at least setting the page titles of your site, you SHOULD if you are not already doing it.
On my drupal sites Facebook will typically grab the appropriate description text, so I usually only use the image_src tag.
Although I did have a problem with this once.
Facebook continued to pull one section of text with every page I tried to share.
It was text from a block on the left column of my website.
After troubleshooting it, I realized this block had a tag put in it automatically by the CKEDITOR software.
This was when I realized Facebook will just grab the text from the first tag it saw.
This tag shouldn't have been there, so I removed it from the block text and then Facebook started to pull the description text from the body text of my content pages.
Problem solved? Make sure to check your blocks and areas on your site which shouldn't be tagged as paragraphs but is.
If you make changes to your code or the page and Facebook has already previously added it to their site, they will have cached the data and it will continue to pull the old data.
The solution is to use the Facebook linter tool, which will scrape the data once again and refresh with your code/data changes and should pull up the current image or text.
You can use the Linter here: http://developers.
Facebook.
com/tools/debug
.
As far as I understand it, Facebook will always pull the current data if they have never seen the link before.
If they have, then odds are it will display the cached data unless they have had a chance to go back and re-scrape that URL.
Not sure when that occurs, so I recommend using the linter tool when you are doing testing.
There are other metatags you can use to control things, such as videos that you may want to show inline in Facebook wall posts.
Check here for the complete list: http://developers.
Facebook.
com/docs/share/
Written by Josh R Bellendir, 2/27/2011 Check out http://www.
jbellendir.
com
for more articles, stories, tutorials, and reviews!


Leave a reply