Add Google Social Tracking

Google launched social tracking for Google Analytics in June, to measure social engagement, social actions and social pages. If you’re already using AddThis with GA, you can integrate with one line of code!

You just need to opt-in:

<script type="text/javascript">
     var addthis_config = {
        /* your GA property ID goes here: */
        data_ga_property: 'UA-123456-1',
        /* set to true to enable social tracking
        data_ga_social : true
     };
</script>

We’ll track the network (e.g. “facebook”), the social action (e.g. “share”), and the target (e.g., http://example.com/your/blog).

If you haven’t already, upgrade to the new version of GA to see the social reports:
Social reports on GA

Google’s got plenty of documentation on the new social analytics features if you need help interpreting their reports. If you’re totally new to Google Analytics and AddThis, check out our help doc on basic integration.

Questions? Comments? Drop us a line in the forums.

  • This is great. Make sure to close the second comment. Should look like: /* set to true to enable social tracking */

  • What do you mean by opt-in? where should I put this code to? Thanks for your advice in advance.

  • hmm..its very interesting..

  • Regan Shepherd

    Just wondering should this code be before your Google Analytics Code, after it or does it not matter? I’m thinking before…

  • The source on this page has:

    var addthis_config = {
    data_ga_tracker: “gaPageTracker”,
    data_track_clickback : true,
    data_track_addressbar: true
    }

    What does it do?

  • I think you may forgot to close the comment:
    /* set to true to enable social tracking */ in your example

  • This is obviously for people who know what they’re doing already. This is not explanatory enough for people like me who’re not that good with codes etc.
    I think it should be explained a little more. Like Cherry said, what do you mean by opt in and where should the code be put.

  • Thank you for sharing this. I updated my script and look forward to seeing results in GA.

  • This Google Analytics also can be used on WordPress by It’s Java Script or WordPress Plugin.

  • Very nice!
    But be sure to close the comment like Adam said or this will not work.
    Maybe someone att addthis can fix the code snippet? =)

  • Hey Anne,

    Feel free to email support@addthis.com so our Tech Lead can help walk you through the process.

  • I’m not getting any stats to show up in GA. I’ve added the extra code underneath the GA code. Could someone take a look at one of my product pages and see if they see something wrong? Here’s a product page: http://www.rainebrooke.com/product/MEWCMX.html
    Thanks.

  • @ Terry – It incorrectly sets the Google Analytics tracking object and enables click tracking and address bar tracking. The correct way to set the Google Analytics tracking object is to do that without quotes, or to set it to your Google Analytics code – e.g. UA-123456-1

  • Hey Regan, the order doesn’t matter :)

  • This is great… its very interesting.. thanks

  • Your profile ID is set incorrectly. You have pub=rainebrooke instead of pubid=rainebrooke

  • it doesnt get any better than this.this is so cool.thanx

  • wil

    hi i enjoy every thing in ur pages that is a degree

  • Yuhui

    How can this be used if I have more than one GA tracker object?

  • Chris

    What exactly are the benefits of this? I don’t see anywhere in Google Analytics to track this information. Am I missing it?