0

我想在不使用谷歌分析的情况下跟踪 googleplusone 点击。有没有可用的功能?我试图用谷歌搜索,但无济于事。

更新:我试过了,但没有触发回调?

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
     <script type="text/javascript" src="https://apis.google.com/js/plusone.js">    </script>
     <script type="text/javascript">
          function helloWorld(plusone) { alert('+1 Triggered, State=' + plusone.state);  } 
     </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <g:plusone  callback="helloWorld"></g:plusone>
    </div>
    </form>
</body>
</html>
4

1 回答 1

0

您将 +1 标记上的回调属性设置为 javascript 函数。

此函数在用户单击 +1 按钮后调用。回调函数必须在全局命名空间中,并且可以接受单个参数,该参数将是具有以下结构的 JSON 对象:

{
  "href": target URL,
  "state": "on"|"off"
}

state 属性设置为“on”表示 +1,“off”表示删除 +1。

于 2011-12-01T02:57:11.797 回答