ユーザーがリンクを正常に共有した場合に「onendinteraction」が「確認」を返す G+ 共有ボタンを作成しようとしています。私はそれを試しましたが、成功しませんでした。「onendinteraction」イベントを通じてユーザー アクティビティをログに記録すると、ユーザーがリンクを正しく共有した場合でも、「ホバー」が返され、「確認」は返されません。
これが私が作成したコードです。非常に単純です: http://codepen.io/anon/pen/DdjAo
<div class="g-plus" data-action="share" data-annotation="none" data-onendinteraction="googleEventShare" data-href="http://codepen.io/"></div>
<script type="text/javascript">
window.___gcfg = {lang: 'en'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<script>
function googleEventShare(params) {
console.log(params.type);
}
</script>