Site icon Web Niraj

Google+ API: Sharing An Interactive Post

The Google+ API allows you to create interactive posts you can share from your website, which contain a call-to-action button with an image and details from the link you want to share. The API lets you pre-fill the text the user can use to share your link (something which Facebook as removed from their API), and gives you options to add in deep-links for mobile apps too.

The code below shows how easy it is to create a interactive share button, with a few lines of JavaScript and some HTML to render the button.

See the gist on github.

You can customise the following attributes:

It is currently not possible to track sharing of the interactive post, but it is possible using the standard Share button.

Exit mobile version