Google +1 button code

Tracking Google +1 button Interaction in Google Analytics

Tracking Google +1 button Interaction in Google Analytics

June 01st, 2011 – 111 Comments

[plus1]Today Google introduced the new +1 button, which I of course immediately implemented (see below and, on this specific post, on the right). It comes with an option for a callback function that you can use to track interaction with that button in Google Analytics. The implementation is pretty easy so let’s go ahead and explain it. First of all, you place the required script tag somewhere, preferably in the footer before the </body>:

&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;;quot;&amp;gt;&amp;lt;/script&amp;gt;

Then you create your +1 button using Google’s creation tool. On this creation tool you click on “Advanced options” and then add plusone_vote as callback. You’ll get something like this:

Google +1 button code

And the code is like this:

&amp;lt;g:plusone size=&amp;quot;tall&amp;quot; callback=&amp;quot;plusone_vote&amp;quot;&amp;gt;&amp;lt;/g:plusone&amp;gt;

Last but not least, below the script tag for Google +1 we added above, you add this tiny bit of script. This function records the vote as an event in Google Analytics, and stores the state (“on” for a +1 vote, “off” for the removal off a vote):

&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
  function plusone_vote( obj ) {

Of course I haven’t been able to do anything with the results from this yet, but it would be cool to see which kind of traffic uses +1 buttons, and whether a lot of +1’s correlate with a lot of search traffic afterwards.

Update: might be fun to show you that this post was ranking quite fast with a nice +1 underlining:
google plus one google analytics

111 Responses to Tracking Google +1 button Interaction in Google Analytics

  1. nokz
    By nokz on 22 June, 2011

    im starting a new blog. is it ok if i added +1 in my new blog? thank you

  2. Top 10 English songs
    By Top 10 English songs on 10 June, 2011

    Really Informative, Thumbs Up!!

  3. Josh
    By Josh on 9 June, 2011

    IMHO, the +1 button will fade into obscurity long before it ever gets a chance to be useful. I would like to think otherwise but Google’s trying to hard to elbow into Facebook territory and it’s just not the same.

  4. hammock
    By hammock on 8 June, 2011

    Google turns into a social network ((

  5. brij
    By brij on 8 June, 2011

    Hi, Thanks for this information.
    I think this +1 mark will help the users of google search engine to now get the right content they are looking for. Otherwise it is very difficult to find the right content on google.

  6. Ed Harris
    By Ed Harris on 5 June, 2011

    Wow Joost, this is incredible, I know I am late but you released this only few hours after official Google post.

    I’ll implement this on my blog asap and will see results soon.

  7. Steve
    By Steve on 5 June, 2011

    I have followed the instructions but cannot see the button on my site. Does this work in the UK ? I cant understand why I can’t see the button.

  8. enursa
    By enursa on 4 June, 2011

    Great. I have installed Google +1, but not for the analytic. I think i must add it now.

  9. glenis
    By glenis on 4 June, 2011

    Needless to say someone will be out with a plugin that will add the plusone to your site and ensure it gets clicked from 15,000 randomly distributed ips. In the end it will be the ‘real’ people who loose.

    I won’t bother I’m not fond of Google tracking what I do, …. or my government, tax department, credit card company, bank, …. I’m paranoid !! :)

  10. Brandon
    By Brandon on 3 June, 2011

    Doesn’t Google say we can’t do this?

    • James
      By James on 4 June, 2011

      Not that I can see. Which line are you referring to?

  11. Allison
    By Allison on 3 June, 2011

    I had been using your Analytics plugin for a while, but about three weeks ago my URLs began showing up as doubled in Analytics [ OR http://whatever/

    I just recently installed the +1 button so am excited about using your plugin to track this, but with my URLs getting all screwed up I’ve been disabling all plugins to try and find out what’s going on.

    Any chance you’ve encountered this before and can make a suggestion? So far the site hasn’t responded.


    The Nerd Connection

  12. Joe from MWD
    By Joe from MWD on 3 June, 2011

    Thanks to yoast I added the button but also added some additional info as to where to place it in wordpress and blogger, thought you might be interested:

  13. Chris
    By Chris on 3 June, 2011

    Is it possible to use jQuery or just plain ol javascript to append the callback=”function” into the gplusone html?

  14. Paul Olyslager
    By Paul Olyslager on 3 June, 2011

    It seems that the +1 button is not visible in IE7.

  15. Simon
    By Simon on 3 June, 2011

    Did implement the plugin, but does anyone know how much relevance it has to the serps?

  16. E-Siber
    By E-Siber on 3 June, 2011

    Hello from Turkey,

    This is awesome. And i have mentioned about your post in my website: with your refer url.


  17. Dave Durbin
    By Dave Durbin on 3 June, 2011

    Always timely. We’ve seen dramatic SERP visibility increase but only for those Google deems in our “Social Circle” and only when the searcher is signed in. This Is Google’s play to make everyone log in to gather demographic info and search behavior I’m sure.

  18. maxmas
    By maxmas on 3 June, 2011

    Nice button.. I’ll try on my blog.

  19. Google +1 WordPres
    By Google +1 WordPres on 3 June, 2011

    Here is a WP plugin to ad the +1 button: add +1 to wordpress

    • Fr4nk
      By Fr4nk on 3 June, 2011

      Thank you for the plugin.
      Must say soon we’ll have full pages of like,+1,retweet etc. buttons… :)

  20. Sreejesh @techgyo
    By Sreejesh @techgyo on 3 June, 2011

    Cool! I just added it in my blog, they’ve made it look simple. It already started bringing traffic to this this page, making it to 1st in SERP. Is that cos of the number of +1s this page have received?

  21. @Mario_Luan
    By @Mario_Luan on 3 June, 2011

    Oh! That’s pretty nice. Thanks!

  22. James
    By James on 3 June, 2011

    @Joost. Can the same thing be done for the Facebook like button, by adding callback=”like_vote” etc to the fb:like code?

  23. Keesjan Deelstra
    By Keesjan Deelstra on 3 June, 2011

    @Joost great script hack. I think Google analytics and webmastertools will at this tracker soon by default?

    Anyway maybe also interesting for your readers: A free research paper about the +1 button and its effect on visbility and CTR.

  24. Jonathan
    By Jonathan on 2 June, 2011

    Thanks for this update, Joost. May I ask how you create the social media buttons bar at the end of your posts?

  25. Elio
    By Elio on 2 June, 2011

    Hi Joost, I’ve implemented your code in the +1 plugin for WordPress released yesterday, with all due credits of course :)

  26. Pierre DeBois
    By Pierre DeBois on 2 June, 2011

    Nice explanation. I think between the +1 / analytics link and tracking with URL for QR codes/within URL shorteners, GA users will be better able to see how far their online exposure goes. If anything it will put pressure on SEO and social media managers to track more thoroughly. Thanks for sharing this.

  27. Erik
    By Erik on 2 June, 2011

    Great Post! Tx – Any input as to when other language versions might be available (I am looking for Dutch) – Thanks – Erik

  28. Chris
    By Chris on 2 June, 2011

    Thanks to you helpful tips I have added +1 with no problem! Will it be showing up under events in Google Analytics?

  29. Dev Basu
    By Dev Basu on 2 June, 2011

    Thanks for the tutorial Joost. We’re going to implement this on a couple of client sites in a non-competitive vertical where we’re pretty sure no one else is using +1 and run some tests to see its effect on the SERPs.

  30. Les Faber
    By Les Faber on 2 June, 2011

    Interesting that one needs to have a Google Profile to use the button. And even more interesting is that we use Google Apps (free) and one cannot create a Google Profile with it. So that means I have to log out of my business G-mail and log into my personal G-Mail account (where I do have a Google Profile) to “Plus 1” you Yoast. You’re a good guy…. and I love your Plugins & Blog posts…. but….

    Seems like Google didn’t think this one through completely….

    So the +1 feature is really about telling Bloggers etc about how many people who use a certain subset of Google products like what has been published. And to heck with anyone else?

    Or maybe I am thinking too much?

    Sidenote: The +1 feature does not seem to be “live” on

    As usual, you do a thorough job Yoast – great post as usual (despite my negative comments towards Google.

  31. Mark
    By Mark on 2 June, 2011


    It’s going nicely as far as I can see. Button seems to be clicked on a lot.

    I’m hoping you get some useful information on GA from this. Thanks for testing this for us. And of course, would love to see this implemented in the GA plugin, lol. By the way, isn’t that integrated right into your WordPress SEO plugin?

    Anyway, thanks again and will be looking for more info here…

  32. Warren Bowman
    By Warren Bowman on 2 June, 2011


    Am I the only one when I click to create the button I get a redirect loop and can’t access the page. I’ve been having this problem since yesterday and tried in 3 different browsers.

  33. William Rock
    By William Rock on 2 June, 2011

    Thx, I cannot wait to see how this takes effect. As Marketers we have known about this update coming from way back but most of the world has no clue on what this is and what to do with it.. So I am interested in how Google will get people to use this addition.

  34. Glen Craig
    By Glen Craig on 2 June, 2011

    Where in Analytics do you see the +1 stats? Thanks!

    • Jordan Louis
      By Jordan Louis on 2 June, 2011

      You’ll see the +1 stats collect under Content -> Event Tracking in the Google Analytics interface.

  35. Rick
    By Rick on 2 June, 2011

    I’m about to added this to my blog as well.

  36. Markus Jalmerot
    By Markus Jalmerot on 2 June, 2011

    Thanks for some good advise as always ;)

  37. Petter El Fakiri
    By Petter El Fakiri on 2 June, 2011

    Could this simple script be used on other buttons aswell then? as for fb, linkedin and other share-buttons

  38. Jim Maidis
    By Jim Maidis on 2 June, 2011

    Thanks for your information about the code for analytics Joost, really curious to see if people use it in the future.

    I think it’a nice move for google to reach the interactivity of facebook like buttons.

  39. NIkhil Kulshrestha
    By NIkhil Kulshrestha on 2 June, 2011

    Hey just notice end of the posts of your blogs. It will present with all social bookmarking sites(twitter, facebook,+1) symbol.

  40. Piet
    By Piet on 2 June, 2011

    Do I mis somethink? I don’t see the +1 button on this page. On Google I read hoe have to be logged in on a Google account. So I am logged in but stil no button. May be because I workshop on the iPad. So how Does the button works?

  41. NIkhil Kulshrestha
    By NIkhil Kulshrestha on 2 June, 2011

    I also added it today and waiting for the response it going to send. But where these responses could be seen, any idea? want to track visitors on my bog as GA. Is it have any such option. Regarding the size and place yes Google need to think again about it. It could miss by most of the visitor. Best place could be “top right of the heading” and just end of the post.

  42. Michele
    By Michele on 2 June, 2011

    Great post!! Thank you so much :)

  43. nokz
    By nokz on 2 June, 2011

    i added mine too in my blog. :)

  44. Joe from MWD
    By Joe from MWD on 2 June, 2011

    How or what plugin are you using to add your share links ?Or you just added it to the theme it self

  45. Michael Aulia
    By Michael Aulia on 2 June, 2011

    Just added it too but mine is still too tiny. Might have to tweak around to make it bigger and more noticeable. I still like the Facebook Like on my posts. Still skeptical how long will this +1 last

  46. Erwin
    By Erwin on 1 June, 2011

    We also added the new vote button of google. Let’s see what kind of results this in give in the SERPs. Btw i don’t see the results like your screenshot in google. Used the search.

  47. Ethan
    By Ethan on 1 June, 2011

    Great post! I just added the +1 button and then realized I’d love to track it w/ Analytics. Did the search you mentioned above and got it added. Thanks.

    I’m curious to see how SERPs are affected. The FAQ states increased crawling and “a useful signal to Google when determining the relevance of your page to a user’s query”. One can hope :)

  48. Brad
    By Brad on 1 June, 2011

    Will this be added to your WordPress SEO plugin soon? =)

    • Brad
      By Brad on 1 June, 2011

      I dont know why I said your SEO plugin. A better place for it would be in the settings for your GA plugin. Or maybe a new plugin.

  49. Martijn van Vreeden
    By Martijn van Vreeden on 1 June, 2011

    Thanks for sharing! This must be a new speed record :) I implemented it immediately. I’m curious to see how many people will use the new button. We’re all so used to tweets and likes…

  50. Ipstenu
    By Ipstenu on 1 June, 2011

    I’m finding it’s pretty hit or miss if it works. It worked for me here, but on other sites, I get a nice red ! to tell me it failed. No explanations, and a java void(0) error. Still, it should be interesting to see how this pans out.

    • Taeke
      By Taeke on 2 June, 2011

      Same here, just added it to some sites and when testing I get a red icon with warning sign. Just +1 this site and all works well, any clue Joost?

  51. André Scholten
    By André Scholten on 1 June, 2011

    Nice, implemented it right away.

    • André Scholten
      By André Scholten on 1 June, 2011

      Added some tweaks though: change the URL of the plusone.js to https because the http version redirects to it. And I loaded it asynchronous at the end of the body.

  52. Mike Smith
    By Mike Smith on 1 June, 2011

    I just added the +1 button to my blog and am happy to know we’re able to track a bit of it’s use like this. My thought is that the +1 use might help dictate search rankings a bit more than Google is letting on, seeing as how they’re pushing for “quality content” results now, this should give them an inside view as to what people find valuable.

    • Kriti
      By Kriti on 2 June, 2011

      A bit unlikely as if it can affect the search results of the blog, then what about those blogs which havnt installed the feature yet?? but if you are talking about the +1 feature in the search results itself, it could be possible.

  53. Ivan Brezak Brkan
    By Ivan Brezak Brkan on 1 June, 2011

    Could you be any faster? :)) Great and useful reaction to the +1 release…

  54. Alex
    By Alex on 1 June, 2011

    Are you able to see in Analytics any new data which is useful that you were not able to see before? I think people are hitting button-overload.

    • Joost de Valk
      By Joost de Valk on 1 June, 2011

      It’ll be curious to see how many people will actually use it, of course, but I have to think that it’s relevant especially for my readership.

      • Martin
        By Martin on 20 June, 2011

        Good reading, though i agree that its relevant to the readers at this site, i cant help wondering how many of the ordinary google users that will use it, i think one should be very passionated about the site if they are going to give +1’s.

      • Robert Went
        By Robert Went on 4 June, 2011

        Oh Yeah!
        You are the first site to publish this and everyone is creaming over it. Twitter trend of the month so far!
        Love your wordpress tips (I’m a joomla man) and you also helped me out alot with a massive magento project.
        Keep up the good work. You are not unknown in many comunities!

      • Ricky
        By Ricky on 2 June, 2011

        I just implemented it in the sidebar with a text widget, to see what happens. Still waiting to see if i want to include it inside every single post, since it has to be done manually.

  55. Anders
    By Anders on 1 June, 2011


    wondered how i’d be able to track this.

  56. Peter
    By Peter on 1 June, 2011

    Where does the clicks go ?

    Twitter clicks to my account.
    Facebook to my account.
    +1 where ? who can see that ? my google buzz followers ?

Check out our must read articles about Analytics