表单上的跨域跟踪不适用于 ._linkbyPost
我在表单上进行跨域跟踪时遇到问题。我有一位酒店客户,他的表单根据所选选项提交给两个预订引擎之一。然而,据我所知,该表单似乎不是以传统方式设置的,因为它不包含“操作”,而是包含“href”。代码如下。
<!--start quicksearch -->
<div id="qs" align="center">
<div align="center"><img src="images/qs_title.gif" alt="Quick Search">
<table width="200" border="0" cellpadding="0" cellspacing="0">
<!--<form method="post">--><form method="post" onsubmit="pageTracker._linkByPost(this);">
....
<td width="35%" valign="bottom"><div align="left"><a href="javascript:sendToCBE();"><img src="quicksearch/continue-buttom_dreams.gif" alt="Continue" width="83" height="24" border="0" onclick="mojo_roi('continue'); pageTracker._trackEvent('Button', 'Click', 'QuickSearchWidget');"></a></div></td>
</tr>
</table></td>
</tr>
</form>
</table>
</div>
</div>
<!--end quick search-->
我的感觉是,因为没有可调用的“操作”,所以它没有传递任何 cookie 信息。我用作参考的其他网站上的所有其他表单都使用“操作”。有什么想法吗? ._linkbyPost 位置正确还是需要移动?
任何和所有的见解都会非常有帮助。
谢谢!
I'm having an issue with my cross-domain tracking on a form. I have a hotel client who has a form that submits to one of two booking engines depending on the options selected. However, from what I can tell, it doesn't look like the form is set up in a traditional way as it does not contain an "action," but rather an "href." Code below.
<!--start quicksearch -->
<div id="qs" align="center">
<div align="center"><img src="images/qs_title.gif" alt="Quick Search">
<table width="200" border="0" cellpadding="0" cellspacing="0">
<!--<form method="post">--><form method="post" onsubmit="pageTracker._linkByPost(this);">
....
<td width="35%" valign="bottom"><div align="left"><a href="javascript:sendToCBE();"><img src="quicksearch/continue-buttom_dreams.gif" alt="Continue" width="83" height="24" border="0" onclick="mojo_roi('continue'); pageTracker._trackEvent('Button', 'Click', 'QuickSearchWidget');"></a></div></td>
</tr>
</table></td>
</tr>
</form>
</table>
</div>
</div>
<!--end quick search-->
My feeling is that because there is not an "action" to call, that it is not passing along any cookie information. Every other form on other websites I have used as a reference use an "action." Any thoughts? Is the ._linkbyPost in the correct position or does it need to be moved?
Any and all insight would be very helpful.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是行不通的。 Google Analytics 依赖于 POST 功能的本机使用。
缺少“操作”表明该表单是由 JavaScript 使用非本机表单功能进行管理的。因此,您需要调整管理表单的 JavaScript 逻辑(大概是名为
sendToCBE
的函数。_linkByPost
是一个尝试为 99% 的使用做所有事情的函数但在这种情况下,您需要使用
_getLinkerUrl
'看起来像(伪代码):
如果您分享更多有关如何实现此表单的详细信息(例如,
sendToCBE
或mojo_roi
确实这样做,我可以提供更具体的指导。Yes, this will not work. Google Analytics is relying on native usage of the POST functionality.
The absence of an "action" suggests that the form is being managed by JavaScript using non-native form functionality. So, you need to adjust the JavaScript logic that manages the form (presumably, the function called
sendToCBE
._linkByPost
is a function that tries to do everything for the 99% of use cases, but, in this case, it doesn't help.You'll need to do some custom query string adjustment with
_getLinkerUrl
That'll look something like (pseudocode):
If you share more of the details of how this form is implemented (for example, what
sendToCBE
ormojo_roi
do exactly, I can provide more specific guidance.