Setting up Social Interactions

Contact Us or call 1-877-932-8228
Setting up Social Interactions

Setting up Social Interactions

Google has developed a very comprehensive guide to setting up interactions on this link: The information in this sub-lesson will be a highlight of the steps needed to complete on your site.

One last item to cover before we begin. First, all of your Google+ interactions are automatically built into the Google Analytics reports. No need to do anything beyond having Google Analytics installed and a Google+ button on your website pages. Beyond Google+, Google Analytics currently offers tracking support for Facebook and Twitter. And here are the specific actions:

  • Facebook like
  • Facebook unlike
  • Facebook share
  • Twitter tweet

The general idea is that you need to add in _trackSocial code within each of the Facebook and Twitter actions. Below is an example of the full code needed

_gaq.push(['_trackSocial', network, socialAction, opt_target, opt_pagePath]);

The first two parameters, network and socialAction are required fields, while opt_target and opt_pagePath are optional. So, we need to add these parameters right within our social interaction code on our site. And each action, such as a Facebook like button, or a Twitter tweet button, needs to have this customized code built in.

Let's take a look at a Facebook like button example from Google's tutorial.

FB.Event.subscribe('edge.create', function(targetUrl) { _gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]); });

You can see that it is customized to the Facebook requirements. In the second line, you'll notice they have included the parameters of facebook and like, so Google Analytics knows where to place this action.

Overall, this process is fairly tedious, but the end result of having these actions listed within the Google Analytics reports can be very helpful. Let's get thinking about ways to use these tools on our own site in the concluding exercise next.