0

I posted a question on stackoverflow and I haven't received any answers yet. maybe you can help me.... This is the problem:

Like buttons on my page that suppose to give "like" to different comments by their different 'href' given, raise the like count to all like buttons.

Link to my website page: http://petbuy.co.il/ProductCard.aspx?product_id=7873&friend_Id=1000

  • look at the bottom of the page and try to "like" one of the comments and then refresh the page.. If you use a developer tool, you can see that every button iframe gets a different href... The "friend_id" param changes in each button href.. BUT ! If you look at the console log, you see that the response for this request of clicking the like button, uses only the first param of the url: The href is: http://petbuy.co.il/ProductCard.aspx?product_id=7873&friend_Id=1000 And it uses only the product_id=7873 without the friend_Id=1000.

I tried to switch the params, and this time it took only the friend_Id=1000".. I need them both :(( Thanks!!

Natali
  • 59
  • 6

2 Answers2

0

Make sure you add the following Open Graph Metatag:

<meta property="og:url" content="http://petbuy.co.il/ProductCard.aspx?product_id=7873&friend_Id=1000" />

I did not find that tag at all in the code, it should be on EVERY page and it needs to match the URL.

Also make sure the URL is encoded correctly, see here: Encode URL in JavaScript?

...and i assume Server.URLEncode in ASP.

And always use the generator: https://developers.facebook.com/docs/plugins/like-button

It will show you exactly how the URL needs to show up in the code.

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • It was there and I tried to remove it in my many attempts to solve the problem.. I returned it now, still the same problem.. :( – Natali Jul 24 '14 at 13:29
  • seems to work fine in the debugger, so i assume it´s an encoding problem with the like button: https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fpetbuy.co.il%2FProductCard.aspx%3Fproduct_id%3D7873%26friend_Id%3D1000 – andyrandy Jul 24 '14 at 13:36
0

You need two diffrent urls for the like button

<div class="fb-like" data-href="http://petbuy.co.il/ProductCard.aspx?product_id=7873&amp;friend_Id=2000" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>

and

<div class="fb-like" data-href="http://petbuy.co.il/ProductCard.aspx?product_id=7873&amp;friend_Id=1000" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>

The Meta og:url is correct and describs the url of the page..

MFGSparka
  • 145
  • 9