The Recommendations Bar allows users to like content, get recommendations, and share what they’re reading with their friends.
The Recommendations Bar is always docked to the lower right (or left) of the screen. When the page loads the Recommendations bar will be collapsed and the user will have the option to ‘like’ your page.
As the user nears the end of your page, the plugin will expand. The expanded view will show the user a social recommendation of the next article to read on your site.
You must include open graph markup on your articles so Facebook knows how to display them on the site. If you do not include this, the plugin will show an error message instead of a recommendation.
Expanding the plugin
The plugin is expanded once the
trigger parameter requirements are met, and the person has been on the page for at least the duration specified in the
read_time parameter. There are three values for the
onvisible- the plugin is expanded when a user scrolls past the exact point where the
<fb:recommendations-bar />tag is placed on the page. This is the simplest option and will work best if you place the tag right at the end of your article's main content. This is the default.
Xis any positive integer less than or equal to 100. This specifies the percent of the page the user must scroll down before the plugin is expanded. For example:
100%would indicate that a user needs to scroll all the way to the end of the page before the plugin expands.
50%would be to the mid point of the page.
manual- use this option to manually trigger the plugin. When you want to trigger the plugin, call
hrefparameter is optional and will default to the current page if not set. If provided, it must match the
hrefparameter on the XFBML tag. The manual trigger is useful when you have more a multi-page article. For example on a three page article, you would add
trigger="manual"on pages one and two and never call the
read_time parameter tells the plugin to wait a certain amount of time before it expands. It takes an integer representing the number of seconds. By default this will be set to 30 seconds. The minimum is 10 seconds. Note that in order for the plugin to expand, the
trigger condition must be true, and the
read_time must be met.
href- the URL of the page. The XFBML version defaults to the current page.
trigger- when the plugin expands. Note that this parameter is evaluated in addition to the
read_timeparameter. Default is when a user scrolls past the <fb:recommendations-bar/> tag. There are three options.
onvisible- read is published when a user scrolls past the exact point where the XFBML tag is placed on the page.
X%- where X is any positive integer less than or equal to 100. Indicates % of page scrolled past before read is triggered
manual- use this option to manually trigger the read action. You call
FB.XFBML.RecommendationsBar.markRead(href);when you want the plugin to expand. The
hrefparameter is only necessary if the <fb:recommendations-bar/> tag includes an explicit
hrefattribute. By default, this is the current request URL.
read_time- The number of seconds before the plugin will expand. Default is 30 seconds. Minimum is 10 seconds.
action- The verb to display on the button. Options: 'like', 'recommend'
side- the side of the screen where the plugin will be displayed. This will automatically adjust based on the language, or can be set explicitly. Options: 'left', 'right'
site- a comma separated list of domains to show recommendations for. The default is the domain of the
ref- a label for tracking referrals; must be less than 50 characters and can contain alphanumeric characters and some punctuation (currently +/=-.:_). The ref attribute causes two parameters to be added to the referrer URL when a user clicks a link from a stream story about a Like action:
fb_ref- the ref parameter
fb_source- the stream type ('home', 'profile', 'search', 'other') in which the click occurred and the story type ('oneline' or 'multiline'), concatenated with an underscore.
num_recommendations- the number of recommendations to display. By default, this value is 2 and the maximum value is 5.
max_age- a limit on recommendation and creation time of articles that are surfaced in the plugins, the default is 0 (we don’t take age into account). Otherwise the valid values are 1-180, which specifies the number of days.