Add a Facebook Like and Facebook Comments to your Google Site

I managed to add a Like Button and a Facebook Comment on my google site.

To do so I had to develop a custom Google Gadget that embeds the javascript code.

That’s not so complex.

What was less simple, was to find the code to get the page url where the gadget is embedded.

I found it on stackoverflow (thanks to Vaibhav) :

var url = (window.location != window.parent.location) ? document.referrer: document.location;

 
You can see the result here (go to the bottom of the pages):

One thought on “Add a Facebook Like and Facebook Comments to your Google Site

  1. eish

    Can you please write the whole code? I’m tring to make the same gadget and don’t know where to put the code you wrote.
    Thanks

    Reply

Leave a comment