Track social interactions as events for the google +1 button

Google Analytics released recently the _trackSocial  for Google Analytics. It was part of a bigger release on several Social applications including Google+. Sometimes things have to be pushed out before they’re extensively tested, and a couple of bugs may come up.

With the social Tracking one specific bug bit me the other day. Google Analytics won’t apply hostname filter’s to the social interactions, and it may cause profiles that are filtered to only include traffic to domain A, showing social interactions for domain B. From there all sorts of bad things follow: 0 pageview visits, lower pages/visit and so on.

At first I thought about disabling the socialTracking on the +1 buttons, but it seems that the API don’t support it yet. But I found an undocumented feature to disable it. Now you can disable the socialtracking on the +1 button and use Events instead, since they go through the filters before showing up in your Google Analytics profile.

You’ll only want to use it if you are having problems with social tracking and hostnames filter. Otherwise the default behavior is way better since it will populate in separate Social reports.

Update

If you are using the asynchronous code for Google +1 button, loading the syntax is a little bit different.

Thanks Fábio Phms.

  • http://phms.com.br Fábio Phms

    For cases where the script is loaded by another javascript code and is not possible to apply the suggestion of Mr. Cereto.It is possible to perform the following solution.Before the call of “plusone.js,” we must set the following variables:

    window.___gcfg = {   google_analytics: false,   gwidget: {google_analytics: false}};window.___cfg = window.___gcfg;

    • http://eduardo.cereto.net/ Eduardo Cereto Carvalho

      Thanks Fábio, I updated the post. I wonder why they hid the google_analytics tag behind a gwidget variable. That’s the problem with using undocumented features, they can change or no obvious reason.

  • Pingback: Google Analytics: 2011 in Review « Happy Marketer

  • Gautier Lemesle

    Thanks for this ; was looking for a way to remove _trackSocial as my filtered profiles are getting all social data and it sucks…

  • Pingback: Google Analytics Year in Review « HelpLearn.asia