【发布时间】:2018-01-21 03:31:29
【问题描述】:
今天我在我的网站中安装了谷歌分析事件跟踪代码,以便能够跟踪有多少人点击了“购买票”按钮 URL,从而查看我们的广告是否有效,因为这些页面只能通过以下方式访问此示例适用于 facebook。
我必须安装更新版本的 GA 代码、Google 跟踪代码管理器,然后将 onclick 功能插入到我的代码中。
在本页成功实现后:https://biscuitsandblues.com/popachubbyfb
我曾尝试在其他几个页面上反映我所做的工作以继续,但是我遇到了一个错误,在将我的代码的 onclick 部分添加到接下来的几个页面后,按钮变得无用并且不再需要我的网址。 -> https://biscuitsandblues.com/curtissalgadofb - 或 - https://biscuitsandblues.com/earlthomasfb
两个页面之间代码的唯一区别是日期已更改以反映当前的登录页面。
工作按钮 Onclick 代码:
<div class="ticketbutton">
<a href="https://www.opentable.com/r/biscuits-and-blues-reservations-
san-francisco?covers=2&datetime=2018-03-
02T18%3A30&restref=2474&searchdatetime=2018-03-02T18%3A30&partysize=2"
class="myButton"
onclick="trackOutboundLink('https://www.opentable.com/r/biscuits-and-
blues-reservations-san-francisco?covers=2&datetime=2018-03-
02T18%3A30&restref=2474&searchdatetime=2018-03-
02T18%3A30&partysize=2'); return false;"> Purchase Tickets</a>
</div>
请帮我弄清楚这个疯狂!谢谢
编辑:遵循这些说明https://support.google.com/analytics/answer/1136920?hl=en
【问题讨论】:
-
购票按钮适用于您提到的所有三个链接(至少在 Chrome 和 Firefox 中)。所谓工作,我的意思是他们带我去开放网站买票。你看到别的了吗?
-
嗨史蒂夫,感谢您的回复。我正在查看网站上的下部按钮,而不是顶部按钮,这是由 opentable 提供的小部件。是的,你说得对,我想让它带你去 opentable 买票。
标签: javascript html google-analytics