By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

Tracking link clicks reliably

P: n/a
What's a good way to send tracking information to my server when a
FORM submission occurs? Right now I build a URL that goes to a server
side script that records the information. Then I set an IMG element's
SRC attribute to that URL. In Internet Explorer, I do this operation
in the form submit handler and in FireFox, in an event listener for
the form.

In either case when I test it, I see that I'm missing a lot of data.
I'm wondering if the browser isn't bothering to actually set the IMG
SRC attribute since it is exiting the document.

Is there a more reliable way to get the tracking data out to my
server? Preferably a Javascript method?

Would executing the operation from the OnClick handler be more
reliable than my current method?

Jun 23 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ro************@gmail.com said the following on 6/22/2007 10:16 PM:
What's a good way to send tracking information to my server when a
FORM submission occurs?
Put your tracking information in a hidden field, submit the form, let
the server pull out the information and log it.
Right now I build a URL that goes to a server
side script that records the information. Then I set an IMG element's
SRC attribute to that URL. In Internet Explorer, I do this operation
in the form submit handler and in FireFox, in an event listener for
the form.
Bad idea.
In either case when I test it, I see that I'm missing a lot of data.
I'm wondering if the browser isn't bothering to actually set the IMG
SRC attribute since it is exiting the document.
No, it is setting the SRC property and then navigating away which
cancels the request from the server and it never gets there.
Is there a more reliable way to get the tracking data out to my
server? Preferably a Javascript method?
See above.
Would executing the operation from the OnClick handler be more
reliable than my current method?
No. Read above.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.