Tracking link clicks reliably

R

robert.oschler

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?
 
R

Randy Webb

(e-mail address removed) 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top