DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > Tracking Social Interactions with Google Analytics

Tracking Social Interactions with Google Analytics

Kin Lane user avatar by
Kin Lane
·
Jul. 06, 11 · Web Dev Zone · Interview
Like (0)
Save
Tweet
3.02K Views

Join the DZone community and get the full member experience.

Join For Free

I’m spending time this week updating my social sharing buttons, claiming authorship of my blog posts, and linking with my Google profiles.

A big part of this is also to update my Google Analytics to track social interactions with kinlane.com and blog.apievangelist.com.

If you have set up both Google +1 and the latest version of Google Analytics on the same page, all +1 social interactions will be tracked automatically.

To get social interaction tracking and reporting for other networks like Facebook or Twitter, you need to integrate Google Analytics tracking along with each network button.

Using Google Analytics Social Tracking, you can record interactions range from a Facebook “Like” to a Twitter “Tweet.” This allows me to view track on these social interactions along with other traffic to my blogs, in my Google Analytics dashboard.

I added tracking for Facebook recommendations:

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

Also added tracking for Facebook shares:

FB.Event.subscribe('message.send', function(targetUrl) {
  _gaq.push(['_trackSocial', 'facebook', 'send', targetUrl]);
});

Then I added tracking for tweets:

twttr.events.bind('tweet', function(event) {
  if (event) {
    var targetUrl;
    if (event.target && event.target.nodeName == 'IFRAME') {
      targetUrl = extractParamFromUri(event.target.src, 'url');
    }
    _gaq.push(['_trackSocial', 'twitter', 'tweet', targetUrl]);
  }
);

There were not ready to go scripts for tracking LinkedIn and StumbleUpon. I will be working on these as I can, so that I can track shares from my blogs to these social networking and bookmark sites.

From http://www.kinlane.com/2011/07/tracking-social-interactions-with-google-analytics/

Google (verb) Interaction Analytics

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • An Overview of 3 Java Embedded Databases
  • The Right Way to Hybridize Your Product Development Technique
  • Why Is Software Integration Important for Business?
  • Maven Tutorial: Nice and Easy [Video]

Comments

Web Dev Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo