Table of contents
- 1. Google Analytics
- 1.1. The Default Tracking Behaviour
- 1.1.1. _trackSocial
- 1.1.2. _trackEvent
- 1.2. Overriding the Default Behaviour
- 1.3. Live Example
- 1.1. The Default Tracking Behaviour
- 2. Omniture SiteCatalyst
- 3. Tracking Social Events
If you are already tracking your website’s traffic with a 3rd-party analytics platform such as Google Analytics, Omniture SiteCatalyst, Webtrends, KissMetrics or other, this guide will show you how to easily include additional data from Gigya's social events. This will give you the ability to analyze the usage of Social Login and other social activities, such as sharing and commenting, on your site. More importantly, you will be able to see how those social actions are impacting the Key Performance Indicators (KPIs) you are already tracking (e.g. are socially logged-in users more likely to purchase than non-social users?). Tying Gigya into your 3rd-party analytics will also give you the granularity of social interaction reporting down to the individual URL (i.e. piece of content or product level), so you can see all-time and historical comparison views of top shared content, for example.
Gigya offers a plug&play analytics integration solution for Google Analytics, as well as for Omniture Genesis Platform.
In addition, Gigya offers a simple code integration for any 3rd-party analytics platform. Read more in the Tracking Social Events section below, the section includes comprehensive code examples.
Google Analytics
Gigya provides a plug&play solution for Google Analytics. Integrating the solution is simple, all you have to do is load a the gigyaGAIntegration.js file in the relevant pages.
Add the following line to the <HEAD> section of each page that you would like to include in your analytics:
<script type="text/javascript" src="http://cdn.gigya.com/js/gigyaGAIntegration.js" >
The Default Tracking Behaviour
Gigya's plug&play solution has a default configuration, specifying which Gigya events will be tracked and how. Google analytics defines two methods to track social events: _trackSocial and _trackEvent. Gigya's default configuration maps the social events to the Google tracking methods as specified below:
_trackSocial
The Gigya events that are mapped to the _trackSocial method are: onSendDone, onFollowClicked.
You will find the analytics of these events in the following section of your Google Analytics standard reports:
The following table specifies, per Gigya event, the data that we pass to the _trackSocial method:
| Gigya Event | network parameter | socialAction parameter | opt_target parameter | opt_pagePath parameter |
|---|---|---|---|---|
| onSendDone (triggered by the sharing related plugins: socialize.showShareUI, socialize.showShareBarUI, socialize.showReactionsBarUI, gm.showNotifications) | Provider (Note: If there is more than one provider, _trackSocial is called for each provider separately.) | "Gigya " + [plugin method name] + " - Share Published" (e.g. "Gigya showShareUI - Share Published") | The current page URL | NA |
| onFollowClicked (triggered by socialize.showFollowBarUI) | Provider | "Gigya Follow - button clicked" | The current page URL | NA |
_trackEvent
The Gigya events that are mapped to the _trackEvent method are: onReactionClicked, onReactionUnclicked, onCommentSubmitted, onCommentVoted, onLogin, onLogout, onConnectionAdded, onConnectionRemoved.
You will find the analytics of these events in the following section of your Google Analytics standard reports:

The following table specifies, per Gigya event, the data that we pass to the _trackEvent method:
| Gigya Event | category parameter | action parameter | opt_label parameter |
|---|---|---|---|
| onReactionClicked (triggered by socialize.showReactionsBarUI) | "Gigya Reaction Bar" | "Button Clicked" | Reaction text |
| onReactionUnClicked (triggered by socialize.showReactionsBarUI) | "Gigya Reaction Bar" | "Button UnClicked" | Reaction text |
| onCommentSubmitted (triggered by socialize.showCommentsUI) | "Gigya Comments" / "Gigya Reviews" (Defined according to the value of the event's "mode" field which can be either "comments" or "reviews") | "Comment Published" / "Review Published" | Comments streamID |
| onCommentVoted (triggered by socialize.showCommentsUI) | "Gigya Comments" / "Gigya Reviews" | "Comment Voted" / "Review voted" | Comments streamID |
| onLogin (triggered by socialize.login, socialize.showLoginUI and various plugins) | Login source name (e.g. "Gigya Login UI", "Gigya Comments", "Gigya Login API", etc.) | "Social Login" | Provider |
| onLogout (triggered by socialize.logout and various plugins) | Logout source name | "Logout" | Provider |
| onConnectionAdded (triggered by socialize.addConnection, socialize.showAddConnectionsUI and various plugins) | Connect source name (e.g. "Gigya Add Connection UI", "Gigya Comments", "Gigya Add Connection API", etc.) | "Social Connection Added" | Provider |
| onConnectionRemoved (triggered by socialize.removeConnection, socialize.showAddConnectionsUI and various plugins) | Remove connection source name | "Social Connection Removed" | Provider |
Overriding the Default Behaviour
Gigya defines an "Event Map", defining which Gigya events will be tracked and how. The default "Event Map" specifies the mapping that is elaborated in the tables above. You may override (or add to) the default "Event Map" by setting the customEventMap parameter of the Global Conf object. Learn more in Overriding the Default Event Map. You may also track events manually, as described in the Tracking Social Events section below.
Live Example
Please check out our live Demo Site and refer to the Demo Site Implementation Guide.
The demo site uses Google Analytics for tracking page view and social events. The site includes implementation of Gigya's Social Login and several of Gigya's plugins: Share Bar plugin, Reactions plugin, Comments plugin, and more. The events that are triggered by these plugins are reported to Google Analytics.
Omniture SiteCatalyst
If you are working with Omniture SiteCatalyst analytics, use Custom Link Tracking to track social events. To do so, first register to the Gigya event that you would like to track. In the event handler method apply the Custom Link Tracking code to report the event to Omniture SiteCatalyst. See the following code example:
// Register to Gigya's onLogin event
gigya.socialize.addEventHandlers({
onLogin: trackLoginEvent // call trackLoginEvent when Social Login finishes successfully
}
);
// trackLoginEvent - event handler
function trackLoginEvent(event) {
var action = event.eventName + ": " + event.provider;
// Report the event to Omniture - the "Custom Link Tracking" code:
s.linkTrackVars=”action,events";
s.linkTrackEvents=”GigyaSocialEvents”;
s.events=”GigyaSocialEvents”;
s.action=action;
s.tl(this,’o’, action);
} You may find more code examples in the Tracking Social Events section below.
Plug&Play Solution for Genesis Platform
Gigya is partnered with Adobe to provide comprehensive social analytics and reporting for Adobe Genesis customers. With this integration, Genesis customers can access social analytics that provide metrics on customers’ social profiles and social interactions.
Gigya - Genesis Integration Configuration:

For more information please contact your Gigya account manager.
Tracking Social Events
Gigya's JavaScript API fires events to which you can listen, and reports these events to your analytics provider. Please refer to the Events guide, which shows how to handle events generated by Gigya.
How to Track User Login Events
Gigya generates the following global events: onLogin, onLogout, onConnectionAdded, and onConnectionRemoved.
Register to the events that you would like to track. In the event handler method report the event to your analytics provider:
// Register to Gigya's onLogin event
gigya.services.socialize.addEventHandlers({
onLogin: trackLoginEvent // call trackLoginEvent when Social Login finishes successfully
}
);
// trackLoginEvent - event handler
function trackLoginEvent(event) {
var action = event.eventName + ": " + event.provider;
// Report the event to Omniture - the "Custom Link Tracking" code:
s.linkTrackVars=”action,events";
s.linkTrackEvents=”GigyaSocialEvents”;
s.events=”GigyaSocialEvents”;
s.action=action;
s.tl(this,’o’, action);
} // Register to Gigya events
gigya.services.socialize.addEventHandlers({
onLogin: trackLoginEvent // call trackLoginEvent when Social Login finishes successfully
}
);
// trackLoginEvent - event handler
function trackLoginEvent(event) {
var action = event.eventName + ": " + event.provider;
// Report the event to Google Analytics using the trackEvent method
_gaq.push(['_trackEvent', 'Gigya Social Login', action, document.title]);
} // Register to Gigya's onLogin event
gigya.services.socialize.addEventHandlers({
onLogin: trackLoginEvent // call trackLoginEvent when Social Login finishes successfully
}
);
// trackLoginEvent - event handler
function trackLoginEvent(event) {
var action = event.eventName + ": " + event.provider;
// Report the event to your Analytics provider
// ...
}
How to Track Sharing Events
Share Bar
The Share Bar plugin generates the following events:
- onSendDone - when the sharing process completes successfully.
Register to the events that you would like to track. In the event handler method report the event to your analytics provider:
// onSendDone - event handler method, called after Gigya finishes the sharing process
// Reports the event to Omniture SiteCatalyst
function onSendDone(event) {
if(event.providers) {
var providers = event.providers.split(",");
for(i = 0; i < providers.length; i++) {
var provider = providers[i];
// Omniture's "Custom Link Tracking" code:
s.linkTrackVars=”action,events";
s.linkTrackEvents=”GigyaSocialEvents”;
s.events=”GigyaSocialEvents”;
s.action= provider + ": Share Published";
s.tl(this,’o’);
}
}
}
var ua = new gigya.services.socialize.UserAction();
ua.setLinkBack("http://vimeo.com/24400434");
ua.setTitle("Changing Education Paradigm by Sir Ken Robinson");
// Define Share Bar plugin's Parameters
var shareBarParams ={
userAction:ua,
shareButtons: "share, email, twitter-tweet, google-plusone, facebook-like",
containerID: 'divButtons' // location of the Share Bar plugin,
onShareButtonClicked: onShareButtonClicked, // onShareButtonClicked method is called when one of the plugin's buttons is clicked
onSendDone: onSendDone // onSendDone method is called after Gigya finishes the publishing process.
}
// Load Share Bar plugin
gigya.services.socialize.showShareBarUI(shareBarParams); // onSendDone - event handler method, called after Gigya finishes the sharing process
// Reports the event to Google Analytics
function onSendDone(event) {
if(event.providers) {
var providers = event.providers.split(",");
for(i = 0; i < providers.length; i++) {
var provider = providers[i];
// Report the event to Google Analytics using the trackSocial method
_gaq.push(['_trackSocial',provider,"Share Published", document.title]);
}
}
}
var ua = new gigya.services.socialize.UserAction();
ua.setLinkBack("http://vimeo.com/24400434");
ua.setTitle("Changing Education Paradigm by Sir Ken Robinson");
// Define Share Bar plugin's Parameters
var shareBarParams ={
userAction:ua,
shareButtons: "share, email, twitter-tweet, google-plusone, facebook-like",
containerID: 'divButtons' // location of the Share Bar plugin,
onShareButtonClicked: onShareButtonClicked, // onShareButtonClicked method is called when one of the plugin's buttons is clicked
onSendDone: onSendDone // onSendDone method is called after Gigya finishes the publishing process.
}
// Load Share Bar plugin
gigya.services.socialize.showShareBarUI(shareBarParams); // onSendDone - event handler method, called after Gigya finishes the sharing process
// Reports the event to your Analytics provider
function onSendDone(event) {
if(event.providers) {
var providers = event.providers.split(",");
for(i = 0; i < providers.length; i++) {
var provider = providers[i];
// Report the event to your Analytics provider
// ...
}
}
}
var ua = new gigya.services.socialize.UserAction();
ua.setLinkBack("http://vimeo.com/24400434");
ua.setTitle("Changing Education Paradigm by Sir Ken Robinson");
// Define Share Bar plugin's Parameters
var shareBarParams ={
userAction:ua,
shareButtons: "share, email, twitter-tweet, google-plusone, facebook-like",
containerID: 'divButtons' // location of the Share Bar plugin,
onShareButtonClicked: onShareButtonClicked, // onShareButtonClicked method is called when one of the plugin's buttons is clicked
onSendDone: onSendDone // onSendDone method is called after Gigya finishes the publishing process.
}
// Load Share Bar plugin
gigya.services.socialize.showShareBarUI(shareBarParams);
Share
The Share plugin generates the following events:
- onLoad - when a share plugin appears on screen.
- onSendDone - when the sharing process completes successfully.
Register to the events that you would like to track. In the event handler method report the event to your analytics provider:
// onLoad - event handler method, called when the plugin has finished drawing itself.
// Reports the event to Google Analytics
function onLoad(event) {
// Report the event to Google Analytics using the trackEvent method
_gaq.push(['_trackEvent', 'Gigya Share','Share Dialog Loaded', document.title]);
}
// onSendDone - event handler method, called after Gigya finishes the sharing process.
// Reports the event to Google Analytics
function onSendDone(event) {
if(event.providers) {
var providers = event.providers.split(",");
for(i = 0; i < providers.length; i++) {
var provider = providers[i];
// Report the event to Google Analytics using the trackSocial method
_gaq.push(['_trackSocial',provider,"Share Published", document.title]);
}
}
}
var ua = new gigya.services.socialize.UserAction();
ua.setLinkBack("http://vimeo.com/24400434");
ua.setTitle("Changing Education Paradigm by Sir Ken Robinson");
// Define Share plugin's Parameters
var shareParams ={
userAction:ua,
containerID: 'divButtons' // location of the Share Bar plugin,
onLoad: onLoad, // onLoad method is called when the plugin has finished drawing itself.
onSendDone: onSendDone // onSendDone method is called after Gigya finishes the publishing process.
}
// Load the Share plugin
gigya.services.socialize.showShareUI(shareParams); // onLoad - event handler method, called when the plugin has finished drawing itself.
function onLoad(event) {
// Report the event to your Analytics provider
// ...
}
// onSendDone - event handler method, called after Gigya finishes the sharing process.
function onSendDone(event) {
if(event.providers) {
var providers = event.providers.split(",");
for(i = 0; i < providers.length; i++) {
var provider = providers[i];
// Report the event to your Analytics provider
// ...
}
}
}
var ua = new gigya.services.socialize.UserAction();
ua.setLinkBack("http://vimeo.com/24400434");
ua.setTitle("Changing Education Paradigm by Sir Ken Robinson");
// Define Share plugin's Parameters
var shareParams ={
userAction:ua,
containerID: 'divButtons' // location of the Share Bar plugin,
onLoad: onLoad, // onLoad method is called when the plugin has finished drawing itself.
onSendDone: onSendDone // onSendDone method is called after Gigya finishes the publishing process.
}
// Load the Share plugin
gigya.services.socialize.showShareUI(shareParams);
How to Track Reaction Events
The Reactions plugin generates the following events:
- onReactionClicked, onReactionUnclicked - when a reaction button is clicked/unclicked.
- onSendDone - when the sharing process completes successfully.
Register to the events that you would like to track. In the event handler method report the event to your analytics provider:
// onReactionClicked - event handler method, called when one of the Reaction plugin's buttons is clicked
// Reports the event to Google Analytics
function onReactionClicked(event) {
var reaction = event.reaction.text;
// Report the event to Google Analytics using the trackEvent method
_gaq.push(['_trackEvent', 'Gigya Reaction Bar', reaction + ' Reaction Button Clicked', document.title]);
}
// onSendDone - event handler method, called after Gigya finishes the sharing process.
// Reports the event to Google Analytics
function onSendDone(event) {
if(event.providers) {
var providers = event.providers.split(",");
for(i = 0; i < providers.length; i++) {
var provider = providers[i];
// Report the event to Google Analytics using the trackSocial method
_gaq.push(['_trackSocial',provider,"Share Published", document.title]);
}
}
}
// Define an array of reaction objects
var textReactions=[
{
text: 'Inspiring',
ID: 'inspiring',
iconImgUp:'http://cdn.gigya.com/gs/i/reactions/icons/Inspiring_Icon_Up.png',
iconImgOver:'http://cdn.gigya.com/gs/i/reactions/icons/Inspiring_Icon_Down.png',
tooltip:'This item is inspiring',
feedMessage: 'Inspiring!',
headerText:'You think this post is inspiring,'
}
,{
text: 'Geeky',
ID: 'geeky',
iconImgUp:'http://cdn.gigya.com/gs/i/reactions/icons/Geeky_Icon_Up.png',
iconImgOver:'http://cdn.gigya.com/gs/i/reactions/icons/Geeky_Icon_Down.png',
tooltip:'This item is geeky',
disabledTooltip:'You found this geeky',
feedMessage: 'This is geeky!',
headerText:'You think this is geeky,'
}
];
var defaultUserAction = new gigya.services.socialize.UserAction();
defaultUserAction.setTitle("This is the post title");
defaultUserAction.setLinkBack("http://www.gigya.com");
var reactionParams ={
barID: 'today-story', // Identifier of the content to which this reaction refers
containerID: 'reactionsDiv', // Reactions Plugin DIV Container
reactions: textReactions, // The reaction array from Step 1
userAction: defaultUserAction, // The UserAction object from Step 2
bodyText: 'Share it with your friends:', // optional - text that appears in the Share popup
showCounts: 'top', // optional - displays the counters on top of the buttons
onReactionClicked: onReactionClicked, // onReactionClickedmethod is called when one of the plugin's buttons is clicked
onSendDone: onSendDone // onSendDone method is called after Gigya finishes the publishing process.
};
// Load the Reactions Plugin:
gigya.services.socialize.showReactionsBarUI(reactionParams); // onReactionClicked - event handler method, called when one of the Reaction plugin's buttons is clicked
function onReactionClicked(event) {
var reaction = event.reaction.text;
// Report the event to your Analytics provider
// ...
}
// onSendDone - event handler method, called after Gigya finishes the sharing process.
function onSendDone(event) {
if(event.providers) {
var providers = event.providers.split(",");
for(i = 0; i < providers.length; i++) {
var provider = providers[i];
// Report the event to your Analytics provider
// ...
}
}
}
// Define an array of reaction objects
var textReactions=[
{
text: 'Inspiring',
ID: 'inspiring',
iconImgUp:'http://cdn.gigya.com/gs/i/reactions/icons/Inspiring_Icon_Up.png',
iconImgOver:'http://cdn.gigya.com/gs/i/reactions/icons/Inspiring_Icon_Down.png',
tooltip:'This item is inspiring',
feedMessage: 'Inspiring!',
headerText:'You think this post is inspiring,'
}
,{
text: 'Geeky',
ID: 'geeky',
iconImgUp:'http://cdn.gigya.com/gs/i/reactions/icons/Geeky_Icon_Up.png',
iconImgOver:'http://cdn.gigya.com/gs/i/reactions/icons/Geeky_Icon_Down.png',
tooltip:'This item is geeky',
disabledTooltip:'You found this geeky',
feedMessage: 'This is geeky!',
headerText:'You think this is geeky,'
}
];
var defaultUserAction = new gigya.services.socialize.UserAction();
defaultUserAction.setTitle("This is the post title");
defaultUserAction.setLinkBack("http://www.gigya.com");
var reactionParams ={
barID: 'today-story', // Identifier of the content to which this reaction refers
containerID: 'reactionsDiv', // Reactions Plugin DIV Container
reactions: textReactions, // The reaction array from Step 1
userAction: defaultUserAction, // The UserAction object from Step 2
bodyText: 'Share it with your friends:', // optional - text that appears in the Share popup
showCounts: 'top', // optional - displays the counters on top of the buttons
onReactionClicked: onReactionClicked, // onReactionClickedmethod is called when one of the plugin's buttons is clicked
onSendDone: onSendDone // onSendDone method is called after Gigya finishes the publishing process.
};
// Load the Reactions Plugin:
gigya.services.socialize.showReactionsBarUI(reactionParams);
How to Track Comments Events
The Comments plugin generates the following events:
- onCommentSubmitted - when a user has submitted a comment.
- onCommentVoted - when a user has voted on a comment.
Register to the events that you would like to track. In the event handler method report the event to your analytics provider:
// onCommentSubmitted - event handler method, called when when a comment is submitted
// Reports the event to Google Analytics
function onCommentSubmitted(event) {
// Report the event to Google Analytics using the trackEvent method
_gaq.push(['_trackEvent', 'Gigya Comments','Comment Submitted', document.title]);
}
var params =
{
categoryID:7623701,
containerID: 'commentsDiv',
onCommentSubmitted: onCommentSubmitted // onCommentSubmitted function is called when a comment is submitted
}
// Load the Comments Plugin
gigya.services.socialize.showCommentsUI(params); // onCommentSubmitted - event handler method, called when when a comment is submitted
function onCommentSubmitted(event) {
// Report the event to your Analytics provider
// ...
}
var params =
{
categoryID:7623701,
containerID: 'commentsDiv',
onCommentSubmitted: onCommentSubmitted // onCommentSubmitted function is called when a comment is submitted
}
// Load the Comments Plugin
gigya.services.socialize.showCommentsUI(params);
http://www.google.com/analytics/support/index.html
http://stackoverflow.com/questions/8817903/why-do-facebook-insights-and-google-analytics-report-different-visitor-counts


Comments