Last active
December 17, 2015 00:49
-
-
Save guillaumew/5524274 to your computer and use it in GitHub Desktop.
Track a Google Plus "+1" in Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Call google plus library--> | |
<script src="https://apis.google.com/js/plusone.js"></script> | |
<!-- Insert +1 button with callback attribute --> | |
<div id="plusBox"> | |
<g:plusone size="Tall" count="true" callback="track_googleplus"> | |
</g:plusone> | |
</div> | |
<!-- Add Javascript Callback function --> | |
<script type="text/javascript"> | |
function track_googleplus(data){ | |
if(data.state=="on"){ | |
alert('ok'); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment