Social Interactions

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


You can use social interaction analytics 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:

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

For a more in-depth description of each of these fields, see Data collection 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

ga('send', 'social', 'Facebook', 'like', '');

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: ''


If you use the official Facebook Like buttons and subscribe to the edge.create event, when a Like action happens, you are notified.

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.