I have a facebook app displayed on my page via an Iframe . I have included the following code on my page to generate the like and comment block .
<div class="my_page_footer">
<script src="https://connect.facebook.net/en_US/all.js"></script>
<div class="my_page_likes">
<fb:like href="<?=$canvas_url;?>" show_faces="true" width="570" font="verdana"></fb:like>
</div>
<div id="fb-root"></div>
<div class="my_page_comments">
<fb:comments href="<?=$canvas_url;?>" num_posts="5" width="570"></fb:comments>
</div>
</div>
Where the canvas url is the iframe src to my app.
However when anybody clicks on Like the iframe src url is posted on their wall instead of the name of the app or the link to the app
Any thoughts ?
Neil
Facebook figures out what to display for a URL using Open Graph headers. For example:
<meta property="og:title" content="..." />
<meta property="og:url" content="..." />
<meta property="og:image" content=""..." />
You can use the OG debugger tool to figure out if your headers are setup correctly.
Related
I am trying to implement Google Plus share on my page but instead of picking title from meta tags it is picking page title from url in share dialog title. Do I need to include anything else?
<meta property="og:title" content="Title"/>
<meta property="og:description" content="Description"/>
<a href="https://plus.google.com/share?url={google.com}"/>Link</a>
According to the Google Developer Site, the example code snippet for Google Plus shared links is:
<body itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Shiny Trinket</h1>
<img itemprop="image" src="{image-url}" />
<p itemprop="description">Shiny trinkets are shiny.</p>
</body>
In this page:
http://daytona.bg/model/damska-tunika-751-sreb-tsip_2702/
I have the following code inserted for facebook comments:
<head>
<meta property="fb:admins" content="1816718833"/>
<meta property="fb:app_id" content="443454829050436"/>
</head>
<body>
<div class="fb-comments" data-href="/model/damska-tunika-751-sreb-tsip_2702/" data-num-posts="5" data-width="960"></div>
</body>
But on moderation tool page I don't see any comments:
https://developers.facebook.com/tools/comments?id=443454829050436&view=queue
BTW, everything worked before I changed my application ID (I deleted my old app by mistake).
You should use the full URL on your "data-href". Something like:
<div class="fb-comments" data-href="http://www.exemple.com/model/damska-tunika-751-sreb-tsip_2702/">
I've added a Addthis script to my Facebook page tab;
<div class="addthis_toolbox addthis_default_style addthis_32x32_style"
addthis:title="MY TITLE"
addthis:description="MY TITLE">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=XXXX"> </script>
I've also added the correct Title and description to the Page in my Facebook Tab but when I share, I don't get the correct Title and Description. Instead I get the default from my Facebook homepage?
As Paul points out in the second answer of this thread, facebook share links of addThis donĀ“t work with the normal addThis parameters.
You have to add the required facebook meta tags:
<meta property="og:title" content="Your title here" />
<meta property="og:description" content="your description here" />
to your page.
You can find further tags at the facebook open graph documentation
http://developers.facebook.com/docs/opengraph/
I am building a forum in PHP and I want users to be able to share the title and description of each post to facebook, twitter, ...etc using the Addthis social plugin. Here is the code Addthis has given me:
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style "
addthis:url="www.example.com"
addthis:title="Example Title"
addthis:description="Example Description">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s6.addthis.com/js/154/addthis_widget.js#pubid=rd-39e8r89e9er8er989"></script>
<!-- AddThis Button END -->
I was able to change the url to another I have specified, but changing the title and description has no effect. In fact, they do not even show up when I click the share button and post it to my facebook wall. What is the proper way to get this to work?
AddThis doesn't officially support all these parameters as far as I can tell (I can't find them all in once place in their documentation), so ideally you should just use OpenGraph tags on the page you are on. But in any case...
You need to specify it on the custom buttons themselves, not on the toolbox. You can even specify the image. If your buttons have to come from AddThis instead of specifying them yourself, I'm not sure.
<div class="addthis_sharing_toolbox">
<a class="addthis_button_facebook"
addthis:url="http://google.com/"
addthis:title="Here's a title"
addthis:media="http://images.google.com/example.png"
addthis:description="Here's a cool description">
<i class="ico ico-facebook"></i>
</a>
<a class="addthis_button_twitter"
addthis:url="http://google.com/"
addthis:title="Here's a title"
addthis:media="http://images.google.com/example.png"
addthis:description="Here's a cool description">
<i class="ico ico-twitter"></i>
</a>
<a class="addthis_button_linkedin"
addthis:url="http://google.com/"
addthis:title="Here's a title"
addthis:media="http://images.google.com/example.png"
addthis:description="Here's a cool description">
<i class="ico ico-facebook"></i>
</a>
</div>
AddThis's documentation sucks so I just happened to run into the right things and figure this out. Enjoy!
AddThis specific recommend that you use meta tags from the Open Graph Protocol to specify what to show
We strongly recommend the page-tagging approach over passing your widget parameters to our APIs
So in your case you should have the code lie it's original:
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s6.addthis.com/js/154/addthis_widget.js#pubid=rd-39e8r89e9er8er989"></script>
<!-- AddThis Button END -->
and change your header to include the addThis meta tags, in your example, like:
<meta property="og:url" content="http://www.example.com" />
<meta property="og:title" content="Example Title" />
<meta property="og:description" content="Example Title Description" />
<meta property="og:image" content="http://www.example.com/logo.gif" />
This avoids any problem you can encounter in the Client API.
I went around and around before finding this on the AddThis website:
Setting the URL & Title to Share
...for our newest tools, use the data-url and data-title parameters...
I am using their latest code (addthis_sharing_toolbox instead of addthis_toolbox) and all I could find were people using addthis:url="" which was not working.
to avoid any error due to image,try to set image width to minimuim
<meta property="og:image" content="#TempData["image"]" />
<meta property="og:title" content="#TempData["title"]" />
<meta property="og:url" content="#TempData["url"]" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="400" />
<meta property="og:description" content="#TempData["description"]" />
<meta name="twitter:title" content="#TempData["title"]">
<meta name="twitter:description" content="#TempData["description"]">
<meta name="twitter:image" content="#TempData["image"]">
<meta name="twitter:card" content="summary_large_image">
<meta charset="utf-8" />
added in page where inline toolbox is needed
<div class="addthis_inline_share_toolbox"></div>
added widget.js in layout/master page before closing body tag
<script type="text/javascript" src="https://s7.addthis.com/js/300/addthis_widget.js#pubid=yourpubID"></script>
</body>
***** if any error below checking on information will be helpful ****
check if any redirect happen , then meta tag information should be presented on that page as well,
e.g if "Facebook Sharing Debugger" redirect page to any login page then meta tag required on login page as well
check how your source code look like (https://developers.facebook.com/tools/debug/ ---> Scraped URL)
check on below url, if any error in meta tag
https://developers.facebook.com/tools/debug/ (click on scrape again to see updated changes)
https://cards-dev.twitter.com/validator
https://www.linkedin.com/post-inspector/inspect/
I am building a News section for a client website (in ExpressionEngine) and they have requested that each article have the Facebook like button. So I went to Facebook's developer site and found the necessary code to make it work.
The problem I have is that if I like one article, it counts that like for all of them! I'm using my ee tags for title and permalink in the OpenGraph meta tags, but to no avail.
Open graph code:
{exp:weblog:entries weblog="news" orderby="date" sort="desc" limit="1" disable="member_data|trackbacks"}
<meta property="og:title" content="{title}" />
<meta property="og:type" content="non_profit" />
<meta property="og:url" content="{title_permalink=news/article}" />
<meta property="og:image" content="http://dallascityhomes.net/_images/dch-logo-big.png" />
<meta property="og:site_name" content="Dallas City Homes" />
<meta property="fb:admins" content="--removed--" />
{/exp:weblog:entries}
The actual button (it is wrapped within a exp:weblog:entry tag):
<div>
Tweet
<fb:like href="{title_permalink=news/article}" layout="button_count" show_faces="false" width="80" font="arial"></fb:like>
</div>
And of course the JS script for FB like, I moved to the bottom of the doc:
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
Has anyone encountered this before? Know a solution?
Do the og:url meta property and the href property of the fb:like tag appear to be rendering correctly when you view source?