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

Correct way to implement visitor tracking?

P: n/a
This is my current strategy for tracking hyperlink clicking by a site
visitor (Internet Explorer example):

Using Javascript I:

Attach an event to the document "onclick" handler.
When a click occurs, the Javascript "onclick" event hander I assigned,
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
to record.
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.

thx

Robert.
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:k7**********@hotpop.com...
"Robert Oschler" <no_replies@fake_email_address.invalid> writes:
I have some links that lead to external sites. I like tracking them so I can see what my visitors are interested in, and therefore provide them more content in those areas in the future.
Some of us would call that "snooping on my browsing habits" and would
do our best to foil you scheme (or just avoid your page entirely).
I trust it you have a "privacy policy" that tells people that you log
their browsing?
I don't see how server scripting + URL arguments would work without an
intermediary page for off-site links.


Not for off-site links, no. You have to go through your own links.
I didn't think you would try to log off-site links.
Or am I misreading something?


Nope.
If I have to use the URL + "search argument" method, wouldn't I have to
create an intermediary page to intercept those links and record the tracking info, rather than the direct links I have now?


For pages in your domain, if they are processed on the server, you
don't need a client-side redirect. You can send the new page directly,
and just log the extra information.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'


========================

Lasse,
For pages in your domain, if they are processed on the server, you
don't need a client-side redirect. You can send the new page directly,
and just log the extra information.


Oh yes! I wasn't thinking there, thanks.

--

Robert Oschler
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.