Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Robert Oschler
September 4, 2003, 10:07 pm
rate this thread
visitor (Internet Explorer example):
Attach an event to the document "onclick" handler.
checks to see if the event srcElement (or its parent in the case of a "font"
element) is a hyperlink (tagName = "A" or "a").
If so, I build a URL with the search arguments set to the information I wish
I find a specific IMG element on the page and set it's SRC property to the
URL I built.
If the hyperlink opens a new window using the "_blank" target, this works
flawlessly. If however a new window is not opened, the transaction is lost.
It's as if the IMG element SRC property setting never actually happens.
Is there a way to make this work? Or do I have to create tracking codes for
each hyperlink and change all the URL's to go to a pre-emptive document that
records the click, before showing the desired web page.
Also, is there any way to track how long a visitor leaving your site was on
a the last page they were viewing? I know that most tracking packages can
track a visitor as they move around your site, but how about the page right
before they leave? I've been told that you can do it in the
"onbeforeunload" or "beforeunload" event handlers because any HTTP requests
made during the event handlers will not be processed by the browser. Tests
I have run seems to bear this out (or at least it's _very_ erratic). Is
there a way to do this kind of exit page view tracking?