如何跟踪googleplusone按钮点击?

时间:2011-12-01 02:20:28

标签: asp.net google-plus-one

我想在不使用Google Analytics的情况下跟踪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>

1 个答案:

答案 0 :(得分:0)

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

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

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

州财产设置为&#34; on&#34;对于+1,&#34;关&#34;删除+1。