I want to make like on Stackoverflow. I do not whant +1
button (it takes some time for loading and all page loading are little slower). I've looked on source page and didn't found any info of it... How do they do it???
On facebook this is:
url = 'http://www.facebook.com/sharer.php?s=100'; url += '&p[title]=' + encodeURIComponent(title); url += '&p[summary]=' + encodeURIComponent(text); url += '&p[url]=' + encodeURIComponent(my_url); url += '&p[images][0]=' + encodeURIComponent(pic);
Something like this must be for google+ share to, but i didn't found any helpful information during my search.
I know I can use such url: https://plus.google.com/share?url=my_url
, but it's not enough - I also need share title, text and image, but what url GET parameters to use for this purpose?
Thanks in advance!
A tracking parameter is a defined piece of code that's added to the end of a URL. It can then be parsed by a system backend to share information contained by that URL. At Adjust, we have three distinct groups of parameters that we work with; campaign parameters, redirect parameters and additional parameters.
URL parameters are a set of values in the browser's address bar after the website address. They start with a question mark and could go in a different order or be combined differently. Each URL parameter consists of a key=value pair. Multiple parameters are separated by the ampersand.
URL parameter is a way to pass information about a click through its URL. You can insert URL parameters into your URLs so that your URLs track information about a click. URL parameters are made of a key and a value separated by an equals sign (=) and joined by an ampersand (&).
Custom parameters are an advanced type of URL parameter that you can add to your ad's landing page URLs. Unlike ValueTrack parameters, you can choose what values your custom parameters record once someone clicks on your ad.
The share link supports two url paramaters: url
, for the target url, and hl
, for a language code.
The structured markup on the target url determines the title, description and image shared on Google+. For example, if you add schema.org markup or OpenGraph tags to the page that you're sharing it appears to pick it up just like it does for the +1 button.
In the official docs for the +Snippet it indicates that schema.org markup is preferred. So if you add markup to your page that looks something like this:
<body itemscope itemtype="http://schema.org/Product"> <h1 itemprop="name">Shiny Trinket</h1> <img itemprop="image" src="image-url"></img> <p itemprop="description">Shiny trinkets are shiny.</p> </body>
you will see your title read from the name
field and image from the aptly named image
field.
Alternatively, you can add OpenGraph tags to the head of your page to specify the same fields like this:
<meta property="og:title" content="..."/> <meta property="og:image" content="..."/> <meta property="og:description" content="..."/>
Maybe the following page about sharing interactive posts will be helpful: https://developers.google.com/+/web/share/interactive
I tested it already with the parameter "prefilled". This parameter allows you to define a prefilled text for the google+ share via get parameter:
https://plus.google.com/share?url=my_url&prefilltext=my_prefilled_text
So have a deeper look at the interactive posts page in order to find other possible get parameters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With