What are technical requirements in order to make “Recommend This Site” button work properly

StackOverflow https://stackoverflow.com/questions/9925702

  •  27-05-2021
  •  | 
  •  

Question

I am getting odd and inconsistent "Like" counter results on my site.

Do I need a FB App Id?

Do I need to have this meta tag present on the page?

<meta content="123456789012345" property="fb:app_id" />

Do I need a FB App Id parameter on my iframe tag?

?app_id=123456789012345

Is this iframe tag coded properly (indentation for readability only)?

<iframe
    src="http://www.facebook.com/plugins/like.php
        ?app_id=123456789012345
        &amp;href=http%3A%2F%2Fwww.mysite.com%2F
        &amp;layout=standard
        &amp;show_faces=false
        &amp;width=170
        &amp;action=like
        &amp;font
        &amp;colorscheme=light
        &amp;height=30"
    scrolling="no"
    frameborder="0"
    style="border:none; overflow:hidden; width:170px; height:30px;"
    allowTransparency="true"
>
</iframe>

Thanks

Was it helpful?

Solution

There are a few mistakes in your iframe code, atleast according to the auto-generate feature at Facebook Like Documentation.

Iframe like buttons can't include the Send button, for which their Javascript sdk is required, for this the auto generated code has a parameter &amp;send=false, which is missing in your code.

If you are using the app_id, then again according to the auto gen code the order of parameters is incorrect, although i'm not sure if that could be a problem. Best way is to stick to the auto gen code and modify accordingly.

<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.example.com
&amp;send=false
&amp;layout=standard
&amp;width=450
&amp;show_faces=true
&amp;action=like
&amp;colorscheme=light
&amp;font
&amp;height=80
&amp;appId=123123123123123" 
scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true">
</iframe>

You do not need the app id absolutely(so you can remove the last parameter), but if you use the javscript sdk you need it. For the meta tags you can use your own fb id instead of app id.

It is again best to use the meta tags as generated in the docs from the above link. I would also recommend you to use the meta tags correctly, because that allows the facebook scraper/crawler to get proper info from your site, and display likes on news feeds correctly, with more information.

So just auto-generate your code from the link, and you are good to go. Also go through the documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top