Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Google+’ +1 button generator only shows options for generating dynamic buttons (i.e. via client-side scripting).

For reasons related to German privacy & data protection law, this isn’t acceptable on our website: we need a static link for users to click, without loading scripts or even iframes from third parties.

Luckily, Facebook, Twitter and Google+ actually allow providing sharing links via static URIs, as the related question “Google +1 something via a URL” shows.

In particular, for Google+, the following link allows sharing a URI:

https://plusone.google.com/_/+1/confirm?url={url}&title={title}

Unfortunately, this does not +1 the page, even though the dialog goes as far as saying “You publicly recommended this as {your name here}”. But the page neither shows up in my “+1’s” on Google+, nor in the “+1 Reports” on Google Webmaster Tools.

Is there a way of +1’ing a page via a static URI?

share|improve this question
    
Have you tried it without the &title={title} ? The websites I've read suggest that just plusone.google.com/_/+1/confirm?url={url} works –  Stephen Ostermiller Feb 11 '13 at 15:15
add comment

1 Answer 1

It is possible but its important to note that Google wants data sent and using such methods can break at anytime.

I've read about people using this before but again it can break just as many other methods such as Liking on Facebook does often break.

<script type="text/javascript">
 function loadScript(jssource,thelink) {
   var jsnode = document.createElement('script');
   jsnode.setAttribute('type','text/javascript');
   jsnode.setAttribute('src',jssource);
   document.getElementsByTagName('head')[0].appendChild(jsnode);
   document.getElementById(thelink).innerHTML = "";
  }
  var plus1source = "https://apis.google.com/js/plusone.js";
</script>
<a id="plus1" href="javascript:loadScript(plus1source,'plus1')">Show Google +1</a>
<g:plusone></g:plusone>

W3C Friendly Code

<div class="g-plusone" id="my_plusone></div>
<script type="text/javascript">
  document.getElementById("my_plusone").setAttribute("data-size", "small");
  document.getElementById("my_plusone").setAttribute("data-href", document.location.href);
</script>

References

share|improve this answer
    
Not what I wanted but a good alternative. +1 –  Konrad Rudolph Feb 28 '13 at 15:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.