Skip to main content

Diagnose FaceBook Gadget Problems

Adding a FaceBook developed gadget is - or should be - just like adding any HTML / JavaScript gadget.

Sometime, though, adding a FaceBook gadget just does not produce hoped for results. We see the problem reports in Blogger Help Forum: Get Help with an Issue.
The gadget is blank!
or
The gadget does not update anything!
The problems will typically involve gadget code - and the FaceBook Debugger wizard is unlikely to provide any help.

FaceBook supplied gadgets, when provided by FaceBook Developers from their website, are probably almost as reliable as Blogger supplied gadgets, installed using "Add a Gadget" - Basics.

Even so, adding a FaceBook Developers provided gadget is subject to known gadget problems - and some problems, unique to FaceBook gadgets.
  • Adding a third party gadget, not provided by FaceBook Developers.
  • Editing an HTML gadget, in "Rich Text" mode.
  • Using the "Add your own" code, instead of the "HTML / JavaScript" gadget.
  • Lacking the Facebook SDK for JavaScript.

Adding a third party gadget, not provided by FaceBook Developers.

Only add official FaceBook Developers gadgets, from the official FaceBook Developers website. Some known hackers have been distributing FaceBook branded gadgets, from their websites.

Using a FaceBook branded gadget, not provided by FaceBook Developers, will not be good for your blog, in the long run.

Editing an HTML gadget, in "Rich Text" mode.

If you add HTML / JavaScript code to a standard gadget, and you edit the gadget in "Rich Text" mode, the gadget will not work. Perversely, Blogger gadgets edited in "Rich Text" mode will display the caption "Edit Html".

If you edit an HTML / JavaScript gadget, with "Edit Html" displayed, you will be in "Rich Text" mode - and your HTML / JavaScript code will be interpreted as rich text. The gadget will not work.

When you edit HTML / JavaScript code, such as FaceBook gadget code, always do so with "Rich Text" displayed as a caption.

Using the "Add your own" code, instead of the "HTML / JavaScript" gadget.

When you add an "HTML / JavaScript" gadget, you must select "HTML / JavaScript" from the "Basics" menu, as found in the "Add a Gadget" wizard. The "Add your own" menu tab provides a shell for adding XML coded gadgets.

Almost everybody who reads these instructions will need to use the "HTML / JavaScript" gadget in "Basics". The few of you who do not will know when to use "Add your own", and when to use "Basics".

Lacking the Facebook SDK for JavaScript.

FaceBook gadgets need the FaceBook SDK for JavaScript. Blogger blogs with standard templates will have the SDK already - as most Blogger blogs routinely contain one or more FaceBook buttons.

The "Share Buttons" toolbar, for instance, contains a FaceBook Share button.

Some Blogger blogs - like some third party templates - may not routinely load the FaceBook SDK. If a genuine FaceBook Developers gadget, added using "Add a Gadget" - Basics, edited in HTML mode, does not work, it may need the SDK loaded. This is not difficult to do.

The SDK code can be added into an existing Blogger HTML gadget - or you may use a separate gadget. If you are adding a single FaceBook gadget - as in this exercise - simply add the SDK code in front of the FaceBook gadget code.

You might have:
<!-- Your like button code --> <div class="fb-like" data-href="http://www.your-domain.com/your-page.html" data-layout="standard" data-action="like" data-show-faces="true"> </div>
Add the SDK code:
<!-- Load Facebook SDK for JavaScript --> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <!-- Your like button code --> <div class="fb-like" data-href="http://www.your-domain.com/your-page.html" data-layout="standard" data-action="like" data-show-faces="true"> </div>

And that will be that.

The bottom line is simple.

If you are adding a FaceBook gadget, simply add a standard "HTML / JavaScript" gadget, with the necessary FaceBook code. It is not necessary to use the Template Editor - nor will you need XML escape code, enveloping the HTML / JavaScript code.

Keep it simple, get it working - and get back to work, in your blog.

Comments

Popular posts from this blog

Custom Domain Migration - Managing The Traffic

Your blog depends upon traffic for its success.

Anything that affects the traffic to your blog, such as any change in the URL, affects the success of your blog. Publishing the blog to a custom domain, like renaming the blog, will affect traffic to your blog. The effects of the change will vary from blog to blog, because of the different traffic to every different blog.Followers. People who find your blog because of recommendations by other people.Search engines. Robotic processes which methodically surf your blog, and provide dynamic indexing to people who search for information.Subscribers. People who read your content from their newsfeed reader, such as the dashboard Reading List.Viewers. People who read your content from their browser.No two blogs are the same - and no two blogs will have the same combinations of traffic sources.

Stats Components Are Significant, In Their Own Context

One popular Stats related accessory, which displays pageview information to the public, is the "Popular Posts" gadget.

Popular Posts identifies from 1 to 10 of the most popular posts in the blog, by comparing Stats pageview counts. Optional parts of the display of each post are a snippet of text, and an ever popular thumbnail photo.

Like many Stats features, blog owners have found imaginative uses for "Popular Posts" - and overlook the limitations of the gadget. Both the dynamic nature of Stats, and the timing of the various pageview count recalculations, create confusion, when Popular Posts is examined.