如何跟踪 googleplusone 按钮点击次数?
我想在不使用谷歌分析的情况下跟踪 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>
I would like to track googleplusone clicks without using google analytics. Is there any functionality available for this? I tried to google it but to no avail.
UPDATE: I tried this but the callback is not fired?
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将 +1 标记上的回调属性设置为 JavaScript 函数。
用户单击 +1 按钮后调用此函数。回调函数必须位于全局命名空间中,并且可以接受单个参数,该参数将是具有以下结构的 JSON 对象:
状态属性设置为“on”表示 +1,“off”表示删除+1。
You set the callback attribute on the +1 tag to a javascript function.
This function is called after the user clicks the +1 button. The callback function must be in the global namespace and may accept a single parameter, which will be a JSON object with the following structure:
The state property is set to "on" for a +1, and "off" for the removal of a +1.