Friday, February 03, 2012

Facebook widget "Invalid action type"

UPDATE 11:25a CT: Facebook has fixed the "Invalid action type" error, so you don't have to change your code now, though I don't think the addition will hurt anything, either.

EARLIER: I came into work today with a note from my boss that our Facebook Recommendations widget was displaying "Invalid action type" on our home page. Not good.

I didn't know of another site off-hand that used the same widget, which was the iFrame version of the Recommendations Box Social Plugin, so I did a quick search for "invalid action type" and found that I wasn't alone, along with a possible solution.

GeeksTrack's suggestion is in a comment by Besnik Selimi, though it wasn't quite explicit enough for my tastes. It was enough to get through the solution.

First task was to switch from the iFrame solution to the Javascript SDK version, which I had tested but not implemented.

The affected code for the widget in question was:

<fb:recommendations site="www.statesman.com" width="300" height="245" header="true" colorscheme="light" ref="homepage"></fb:recommendations>


I added the 'data-action="like"' parameter, as suggested by Selimi:

<fb:recommendations site="www.statesman.com" data-action="like" width="300" height="245" header="true" colorscheme="light" ref="homepage"></fb:recommendations>


I'm not sure of a solution for the iFrame code. I tried adding &data-action=like to the url string and that didn't work. Interestingly, even Facebook's widget wizard is busted.

  © Blogger template 'A Click Apart' by Ourblogtemplates.com 2008

Back to TOP