Facebook share not picking up correct URL/Title/Description

hiraldesai Jun 11, 2012 07:42PM EDT

Hi,

I'm having trouble getting the sharing tool to work only for facebook. It works for all other sharing links except for facebook. I'm trying to share a different URL than the one user is browsing at the moment. My code looks like below.

<!-- Begin AddThis Social Share -->
<div class="addthis_toolbox addthis_default_style" addthis:url="http://URL-TO-SOME-OTHER-PAGE-ON-SAME-SITE" addthis:title="Title for the share" addthis:description="Description for the share">

<a class="addthis_button_facebook" title="Send to Facebook" style="margin-top: 5px;">
</a>

<a class="addthis_button_twitter" title="Send to Twitter" style="margin-top: 5px;">
</a>

<a class="addthis_button_google" title="Send to Google" style="margin-top: 5px;">
</a>

<a class="addthis_button_compact" style="margin-top: 5px;"></a>

</div>
<!-- End AddThis Social Share -->

<!-- BEGIN Addthis Javascript -->
<script type="text/javascript">
var addthis_config = {
data_track_clickback: true,
ui_click: true,
data_ga_property: 'MY-GA-CODE',
data_ga_social: true
};
</script>

<script type="text/javascript">
document.write(unescape("%3Cscript src='" + document.location.protocol + "//s7.addthis.com/js/250/addthis_widget.js#pubid=MY-PUBID' type='text/javascript'%3E%3C/script%3E"));
</script>

<!-- END Addthis Javascript -->

1 Community Answers

Paul Jun 12, 2012 12:34PM EDT

Facebook doesn't work like the other AddThis buttons. Instead of accepting parameters that we pass it, Facebook requests the URL you're sharing and gets the data it displays from the meta and link tags in the header. To control how your page is shared on Facebook you should use OpenGraph tags which are described in Facebook's documentation here: http://developers.facebook.com/docs/opengraph/


This question is closed to new answers.

Still need help?


General Topics

 

Developers