Reputation: 89
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!
Upvotes: 0
Views: 874
Reputation: 37315
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):
function submit_redirect_function(){
var url = .... // the logic that creates the URL you're redirecting to onsubmit
url = pageTracker._getLinkerUrl(url); //appends the linker query string to the URL.
window.location = url;
}
If you share more of the details of how this form is implemented (for example, what sendToCBE
or mojo_roi
do exactly, I can provide more specific guidance.
Upvotes: 1