Toll Free: 1-877-695-7388

GTA: (647) 699-2838

Search Engine People
  • SEO
  • SEM
  • CRO
  • Display
  • Blog
  • Why Us
  • Contact
  • Join Our Team
  • Get A Quote

Toll Free: 1-877-695-7388

GTA: (647) 699-2838

How To Track On-Site Social Interaction Better Using _Tracksocial

Anthony Contoleon | June 5th, 2013
Tweet21
Share4
Share
Pin
25 Shares
Track more plugins in Google Analytics
Track more plugins in Google Analytics

Google Analytics has had social reports for a while now. The Social report appears among the other Traffic Source reports such as Sources and Search Engine Optimisation. From here you can view Network Referrals, Conversions, Trackbacks and Data Hub Activity from other Data Hub Partners like Disqus and Reddit. These reports simplify tracking the value of social activity and traffic and they start to work as soon as Google Analytics starts to function on the site.

There is another, very useful report that takes a little more to get started with: the Plugin report. This report tracks how and where users interact with social media plugins on the site. Without any further work, this report will only track any Google+ buttons active on the site. To get more from this report, you will need to do a little more work.

Where Being Socially Active is an Event

To add other social plugins to the Plugin report you will need to use a method very much like the one you use to track events. While similar, these actions will not appear as an Event in Google Analytics. They will not show up in the beta Event Real Time report, nor will they appear in the Event report under content. When set up, they will only be used in the Social Plugin report.

There is not a lot of difference between:
_gaq.push(

['_trackSocial', 'Pinterest', 'Article Pin', 'Location']);
and:
_gaq.push(['_trackEvent', 'Social', 'Click', 'Location']);

Google's own documentation and examples covers tracking both Facebook and Twitter very well. The examples given are fully functional and could more or less be implemented as shown. All that is required is a single Javascript file, linked to from the document, and that is it. A little more is involved for some of the other social networks.

As _trackSocial is close to _trackEvent in how it works, it is possible simply to add it to any link-based social sharing widget such as in the example below. While this is easy to implement, it can be time consuming to maintain and possibly even cause some issues down the track.

<a style="display: inline-block; text-indent: -9999px; overflow: hidden; width: 81px; height: 20px; background: url('https://platform.tumblr.com/v1/share_1.png') top left no-repeat transparent;" title="Share on Tumblr" onclick="_gaq.push(['_trackSocial', 'Tumblr', 'Share', 'pageURL']);" href="http://www.tumblr.com/share">Share on Tumblr</a>

When onclick isn't Enough

Widgets like those supplied by Linkedin or Pinterest are a little bit different, and clicking to share involves a little more than just a simple link. These kinds of widgets require another approach.

<script src="//platform.linkedin.com/in.js" type="text/javascript">
lang: en_US
</script>
<script type="IN/Share" data-counter="top"></script>

Fortunately a click on a Linkedin widget is still a click, and with a little bit of Javascript it is possible to trigger the right code. One approach is to fire off the tracking code on an action, such as a click, in a certain HTML element, such as an li or div, targeted by class:


$('li.linkedin').click(function() {
_gaq.push(['_trackSocial', 'Linkedin', 'Share', 'PageURL']);
});

There is always more that can be done, and if you can set up Events, there is no reason you cannot take the same techniques and apply those to populating your Social Plugin reports in Google Analytics. Or you can simply set up the above as _trackEvent rather than _trackSocial. Personally I prefer to do a little of both, tracking all clicks on social elements on a site as a single Event category, as well as through Social Plugins. Ultimately how you approach this is determined by the requirements of your reporting and the business. Google Tag Manager and Universal Analytics will change a few things around when implemented, but the above can be implemented easily for 'Classic Analytics'.

Tweet21
Share4
Share
Pin
25 Shares
Posted in Analytics & ROI Analysis

About the Author: Anthony Contoleon

Anthony works as an SEM Manager in the tourism and travel industry. Most of his free time is lost to creating comics about the digital industry, writing blog posts and drinking coffee.

Contoleon.com

Recent Posts

  • Maximizing Your E-Commerce Sales:
    A CRO Audit Guide
  • Movin’ On Up! Why Migrating to Google Analytics 4 (GA4) Should be a Priority
  • A Year in Review: The Digital Marketing Trends That Defined 2021
  • The Basics of Video Marketing
  • Just How Much Do Google Reviews Impact Your SEO Ranking?

Categories

  • Analytics & ROI Analysis
  • Company News
  • Content
  • Conversion Optimization
  • CRO
  • Display Advertising/RTB
  • Email Marketing
  • En Español
  • En Français
  • Inbound Marketing
  • Lead Nurture & Marketing Automation
  • Local Search
  • Marketing
  • Mobile
  • Partnership Marketing
  • PPC
  • PR
  • SEO
  • Social Media Marketing
  • Web Design

Additional Posts

Killer Business Email Marketing

Killer Business Email Marketing Tips!

June 5th, 2013 | by Mark Hullin

SEO Interview with the CPO of Shopify

June 4th, 2013 | by Helen M. Overland

How Do You Decide On Your Target Audience (And How Well Do You Know Them)?

June 4th, 2013 | by Unmana Datta

LET'S TALK

Need more information or want to get in touch?

Get in touch!
  • SEO
  • SEM
  • Display
  • Blog
  • Why Us
  • Join Our Team
  • Contact Us
  • Local SEO
  • Small Business SEO
  • Enterprise SEO
  • International SEO

LOCATION

1305 Pickering Parkway,
5th Floor Pickering, L1V 3P2

PHONE

Toll Free: 1-877-695-7388
Greater Toronto Area: (647) 699-2838

Social

© Search Engine People Inc. 2023 – Canada’s Top Digital Agency
© SEP 2023 – A Search Engine People Company | Privacy Policy

Search Engine People