📜 ⬆️ ⬇️

Integration of the AddThis sharing service with Google Analytics

This year, Google Analytics has a new report, Visitors> Social Functions . He, as you can guess, should show the interaction with the site through social buttons (like, share, etc.)
But to track each social button, it was necessary to create a callback function that would call the _trackSocial be tracked by calling the _trackSocial method.
You can read about this in Google Analytics Help: http://code.google.com/intl/ru-RU/apis/analytics/docs/tracking/gaTrackingSocial.html
And it was not a very convenient solution, because There can be a lot of social buttons on the site and each one will have to write a function.

Now there is a more elegant and simple solution for tracking social interaction. Namely, the integration with the service of social buttons AddThis . This service contains a fairly large base of social buttons and wide possibilities for customizing your widget.


To integrate the AddThis widget with Google Analytics, you need to add a small code to the widget call block:
 <script type="text/javascript"> var addthis_config = { data_ga_property: 'UA-xxxxxx-x', data_ga_social: true }; </script> 

As a result, the entire widget call block should look something like this:
 <!-- AddThis Button BEGIN --> <a class="addthis_button" href="http://addthis.com/bookmark.php?v=250"> <img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/> </a> <script type="text/javascript"> var addthis_config = { data_ga_property: 'UA-xxxxxx-x', data_ga_social: true }; </script> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script> <!-- AddThis Button END --> 

Learn more about the integration here: http://www.addthis.com/help/google-analytics-integration

After visitors start clicking on the social buttons of the AddThis widget, the interaction can be seen in GA reports:

There is another interesting indicator in AddThis reports that GA does not have: “Virus” is the ratio of clicks on a shared link to the total number of share of that link.
')
Source: Official Google Analytics Blog

ps successful tracking of social interactions on the site!

Source: https://habr.com/ru/post/132639/


All Articles