简体   繁体   中英

Facebook Javascript Share UI include get variables in link

I am using the facebook SDK to share a page link:

FB.ui({
        method: 'feed',
        link:  'http://freebirdevents.co.uk/test_results/?individual_result=1162',
        caption:$(this).data('message'),
}, function(response){});

However it is ignoring get parameter, I've tried URL encoding to no avail.

However it is ignoring get parameter

That's because you are telling it to :

<link rel="canonical" href="http://freebirdevents.co.uk/test_results/" />

You specified here that the real URL for this piece of content is http://freebirdevents.co.uk/test_results/ . Facebook follows that, and goes on to request that URL to get the relevant meta data from.

If you don't want that – then don't specify this as the canonical URL of the document.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM