Magento Themes and Magento Extensions

How to Track Social Interaction with Google Analytics and AddThis

Share

Tracking your websites social media interactions is becoming a necessary statistic in addition to your other visitor behavior demographics. For some websites, this may even be one of the more important statistics to track: A blog owner may want to see how often a post gets shared after its been published; An e-commerce website may want to know the most popular product among thousands of pages; Or even knowing how many times your page URL’s have been shared in other ways.

If you useGoogle Analytics and implemented this manually, adding social media actions tracking can be done in several ways, including Google’s Guide, which is flexible, yet not as quickly implemented as other methods. If you just need the tracking of basic actions, I suggest to use AddThis’ API.

Note: Keep in mind that after implementing Google Analytics, the tracking of Google Plusinteractions will already be integrated. By implementing the below snippets, tracking the actions for Facebook LikesTwitter and other AddThis plugins you may add will track-able as well.

Although AddThis has a WordPress, Magento and other plugins depending on your CMS, you may want to implement the AddThis codes manually anyway. For example, this snippet of code will include the standard Facebook Like, Tweet and Pin on Pinterest button:

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
<!-- AddThis Button END -->

If you have an account with AddThis, your code may have an extra snippet after addthis_widget.js for tracking stats on their website. Once you implemented your chosen Social Media plugins, you can add the following snippet of code to the footer of your site (the location you place it is optional):

<script type="text/javascript">
      var addthis_config = {
         data_ga_property: 'UA-xxxxxx-x',
         data_ga_social : true
      };
</script>

Social Plugins

The data_ga_property value will need your Google Analytics account number starting with UA-. You can then add other settings to your ‘var addthis_config’ or add other social media sharing features from the AddThis toolbox, but the above snippet of code will be all you need to track social activity on Google Analytics.

If you did the above steps correctly, you can view the interactions on Traffic Sources -> Social -> Social Plugins

Leave a Reply

You must be logged in to post a comment.