Social Interactions

This guide describes how to measure social interactions using analytics.js.


Social interaction analytics allows you to measure the number of times users click on social buttons embedded in webpages. For example, you might measure a Facebook "Like" or a Twitter "Tweet".

While event tracking measures general user-interactions very well, Social Analytics provides a consistent framework for recording social interactions. This in turn provides a consistent set of reports to compare social network interactions across multiple networks.

If you're unfamiliar with social interactions in Google Analytics, or you're not sure what values to use for the social network, action, or target, you should first read the article About Social plugins and interactions in the Analytics Help Center.


Social interaction hits can be sent using the send command and specifying a hitType of social. The send command has the following signature for the social hit type:

ga('send', 'social', [socialNetwork], [socialAction], [socialTarget], [fieldsObject]);

Social interaction fields

The following table summarizes the social interaction fields:

Value Type Required Description
socialNetwork String yes The network on which the action occurs (e.g. Facebook, Twitter)
socialAction String yes The type of action that happens (e.g. Like, Send, Tweet).
socialTarget String yes Specifies the target of a social interaction. This value is typically a URL but can be any text. (e.g. http://mycoolpage.com)

For a more in-depth description of each of these fields, see About Social plugins and interactions in the Analytics Help Center.


The following command sends a social interaction hit to Google Analytics indicating that a Facebook like button was clicked for the site http://myownpersonaldomain.com:

ga('send', 'social', 'Facebook', 'like', 'http://myownpersonaldomain.com');

Note that as with all send commands, the fields passed in the convenience parameters may also be specified in the fieldsObject. The above command could be rewritten as:

ga('send', {
  hitType: 'social',
  socialNetwork: 'Facebook',
  socialAction: 'like',
  socialTarget: 'http://myownpersonaldomain.com'


If using the offical Facebook Like buttons, you can be notified when a like action happens by subscribing to the edge.create event.

FB.Event.subscribe('edge.create', function(url) {
  ga('send', 'social', 'facebook', 'like', url);

For more details, refer to the Facebook JavaScript SDK.


By default, Google Analytics provides integrated reporting for the +1 Button. This means if you have implemented analytics.js and a +1 Button on the same page, all +1 interactions will be automatically reported as social interactions via each of the trackers on the page. For more information on +1 Analytics, including troubleshooting tips, see About Social Analytics in the Help Center.