Skip to content

Instantly share code, notes, and snippets.

@brandonb927
Last active September 25, 2018 13:40
Show Gist options
  • Save brandonb927/6433230 to your computer and use it in GitHub Desktop.
Save brandonb927/6433230 to your computer and use it in GitHub Desktop.
How to add Google Plus comments to your site. Paste this into your page and voila!
<script src="https://apis.google.com/js/plusone.js"></script>
<div id="comments"></div>
<script>
gapi.comments.render('comments', {
href: window.location,
width: '624',
first_party_property: 'BLOGGER',
view_type: 'FILTERED_POSTMOD'
});
</script>
<!-- Similarly, you can add a comment counter to the page as well -->
<script src="https://apis.google.com/js/plusone.js"></script>
<div id="commentscounter"></div>
<script>
gapi.commentcount.render('commentscounter', {
href: window.location
});
</script>
@Supuhstar
Copy link

What is 'BLOGGER'? What is 'FILTERED_POSTMOD'? What are other values for first_party_property and view_type? Where did you get this script?

@brandonb927
Copy link
Author

@Supuhstar I didn't see this comment until now :(

Those properties are something you can customize, and I suggest you do so. This code was borrowed from a blogger post of which I can't find the link to at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment