
It would seem that long ago there were times when it was necessary to register in all social networks to get the code for the buttons for your site, and then mess with the design to seamlessly fit all these buttons into the design. However, now it does not do without the pitfalls, the information about which I want to share.
Currently, there are many services that implement a block of buttons that allow you to quickly share a link to the material. Their advantages over single buttons are obvious:
- You do not need to receive a separate code for each button,
- neat design,
- reduction of page load time (not in all cases),
- ability to track statistics ( not all services ).
Some services want for this "money" or "external link" (which in our time is equivalent), so their use does not seem appropriate. Although sometimes they offer very beautiful and original solutions. For example, I would pay for
this if the developer did not use the AddThis API.
For a long time I used free services on my projects:
AddThis and
Ya.share . I used AddThis, mainly because of the availability of statistics and the ability to display the "share" counter.
Scolding AddThis
One fine day, looking through the pages of the site, I discovered 200 kb of extra code containing tags and text:
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
AddThis utility frame
The full version of this “extra code” can be seen
here .
Of course, the first thing I did was google the “AddThis utility frame” and found
several hundred thousand pages from different sites containing the same garbage (to
make sure ).
It is not difficult to guess that on the same day I removed the AddThis script from all projects, which I recommend to do to those who continue to use it.
Praise Ya.share

Ya.share eventually turned into a wonderful tool.
What makes him happy:
- You can draw any buttons for site design!
- no need to get a unique code for each site ( unlike AddThis )
- Statistics available from Yandex. Metrics
- statistics do not generate additional garbage in the url ( unlike AddThis )
- more recently, you can display statistics counters ( not yet for all services that can be shared )

Ya.share tips
1.
The official designer of the “share” block includes not all services, here’s the most comprehensive list:
yaru,yazakladki,vkontakte,facebook,gplus,twitter,odnoklassniki,moimir,lj,
diary,pinterest,surfingbird,friendfeed,moikrug,blogger,tutby,digg,
evernote,delicious,gbuzz,greader,juick,liveinternet,
linkedin,myspace,pocket
yaru,yazakladki,vkontakte,facebook,gplus,twitter,odnoklassniki,moimir,lj,
diary,pinterest,surfingbird,friendfeed,moikrug,blogger,tutby,digg,
evernote,delicious,gbuzz,greader,juick,liveinternet,
linkedin,myspace,pocket
It looks like this:

2. Counters are not yet advertised. Those. Yandex does not offer them to anyone, but “in the rat” it uses on its projects (
for example ).
Code of the full version of the counters:
In this code, the output of counters, in data-yashareType = "small", instead of "small" you can specify, for example, "big", and this will affect the size of the buttons of the counters accordingly:

But in the code of the “share” block, the size of the buttons in this way cannot be changed. If you need large buttons to “share” without counters, you can draw them yourself.
Important: in some amateur manuals yandex.st/share/cnt.share.js is specified as a source for the counters, although the counters are perfectly content with the yandex.st/share/share.js used for the “share” block, and when outputting on one page the scripts conflict, therefore, if you plan to display both the “share” block and the block with counters, then it suffices to output it once in the header of the site and both blocks will use it.
')
Results of Ya.share year
Many developers do not see the point of publishing absolutely all the buttons from the set available in Ya.share (or are not aware of the existence of new buttons) and are limited to only the most popular services. I hope that my modest statistics will be useful. Almost a year ago, he put the “share” block on a newly created website, which is a few recognized methods for repairing automotive equipment. Results:

Detailed click statistics for each service
Dairikov, surfingbird and tutby buttons were added about six months ago. Button pocket - a day ago.
Not joyful
1. The
“share” block constructor is very sluggishly updated.
2. Counter statistics are displayed only by the Ya.share buttons. Thus, if you use counters with another API along with them, they will show different results:

3. Counters do not display the number of shares on pages with Cyrillic url, such as site.rf / section / article256
4. On the
resource pictures, you can see the buttons “link to the page” (html), “send a link by letter” (postcard) and others, however, the script does not respond to these parameters and how to activate them is not particularly clear
I hope the nuances outlined in the post will be interesting and useful not only for me, and you have not wasted time reading. I would appreciate constructive comments and suggestions for improving the post.