Forum Moderators: DixonJones

Message Too Old, No Replies

Need simple way to track exit clicks

         

mediagirl

7:18 pm on Apr 17, 2005 (gmt 0)

10+ Year Member



I'm looking for a simple way to track exit clicks that will show in my log files. I closely track the pages users follow when navigating my site and I'd like to be able to see if they click out or not.

I don't need anything complex and my only requirement is that it leaves a record in the log file.

Any ideas or suggestions on where to look would be great. I've been researching this for a couple of days now and haven't found anything that works.

Thanks, Anna

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

[edited by: tedster at 4:39 pm (utc) on April 18, 2005]

larryn

1:55 am on Apr 18, 2005 (gmt 0)

10+ Year Member



Anna,

There are two ways to go - one that would make use of the Javascript "onClick" event to make a request that logs to your server, the other that runs a script on your server that then redirects the browser to the final destination. The Javascript method will work as long as your visitors don't disable javascript, while the redirect will not look pretty in the status bar.

Cosmetics aside, both methods work well, and it depends upon where you want to put your efforts. I'd be glad to offer help you with scripts, but you need to tell us if you want to use a server script (PHP, PERL, ASP, etc.) or on the client side (Javascript).

Larry

mediagirl

2:04 am on Apr 18, 2005 (gmt 0)

10+ Year Member



Javascript is what I'm thinking will work best. Again, the only requirement is that it will push a "pageview" into my logfiles so I can track people's path through the site. Is that possible with Javascript?

I found a couple onclick solutions while I was researching this but didn't find anything that worked for me.

Also, all the Link tracking scripts that I found didn't push anything to the log files. They instead stored the data in a separate file which doesn't work.

Hope that gives you a little more information.

Thanks,

Anna

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

[edited by: tedster at 4:40 pm (utc) on April 18, 2005]

coffeebean

2:36 am on Apr 18, 2005 (gmt 0)

10+ Year Member



A good solution described here [webmasterworld.com]; based on the one Google uses.

larryn

3:33 am on Apr 18, 2005 (gmt 0)

10+ Year Member



Anna,

Coffeebean's link pretty much explains the site site - now you need to config your stats program to recgonize the click...

mediagirl

6:35 am on Apr 18, 2005 (gmt 0)

10+ Year Member



What does configuring my stats program to recgonize the click entail?

Anna

mediagirl

7:37 am on Apr 18, 2005 (gmt 0)

10+ Year Member



I've input the script into a test page and it seems that the onclick action is happening too quickly to register in my stats program. Is that possible? I'm not using anything fancy, just statcounter.com. I use their "Visitor Paths" stats. I don't have any configuration permissions with them so am not able to change any preferences. It may be that they have configured something to not recognize the tracking link as a real link.

Anna

mipapage

8:05 am on Apr 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is a service out there that does this quite transparently: Google Search [google.com]

It's free for a week and then you have to pay - I suppose one could hack something like this together themselves if they know enough JS, and with all of these new remote scripting libraries out there, one could do some great user tracking beyond just exit clicks, but that's another story...

kazzz

1:31 am on Apr 19, 2005 (gmt 0)

10+ Year Member



Check out this site, [mach5.com...] they offer a few different version of their log file tracking software, it creates a nice webpage with all the info you could ask for

mediagirl

3:15 am on Apr 19, 2005 (gmt 0)

10+ Year Member



Took a look at it and it doesn't do what I need. I need to see the exact path that a user takes through the site and I need to know if and on which page they click out. Still looking for a solution.

How about this... If I create a popunder that automatically closes itself? The popunder would load an html page that has the tracking code I need to hit the log files. Any forseen problems here? Is that easy to implement on a page with tons of links?

Another thing I tried was to have the link open in a new window and to have the original page link to an anchor on the page. I couldn't get this to show up in the logs though. I'm sure I didn't so something correctly or my stats software is blocking the results. Any ideas on how to get that to work?

Anna

mipapage

9:10 am on Apr 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I can tell you how I would do it if I built it on my own...

Use sessions to track the user through the site. Give each user a unique ID, reporting the path back to a database, and then use the techniques employed by the link I provided above to insert the exit link into the DB.

There are some possible holes that I can think of, but someone who knows remote scripting/Ajax techniques should be able to make it work.

This wouldn't be 100% accurate, but user tracking never is.