: Static Google +1 button 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
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:
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?
More posts by @Eichhorn148
1 Comments
Sorted by latest first Latest Oldest Best
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
Adding the Google +1 Button without Violating Users Privacy
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.