On Tue, Apr 14, 2009 at 1:21 PM, ab3...@gmail.com <ab3...@gmail.com> wrote:
> > I'm new to Django. I'm trying to figure out if there is a well > established design paradigm to collect statistics on hyperlink usage. > > When a visitor follows a <a href=...> link to an external website, I > would like to insert the following information into a mysql database > table: > > - the datetime of the click > - the visitor's IP address > - perhaps the visitor's url if it is easily available > - key identifying which external link was selected > > Note: All visitors are anonymous. My site does not ask them to log in > or support username / password. > > I'd also like to be able to collect similar stats for page visits, > although I have a less-detailed workaround for this using Google > Analytics. > > > The only way to know when an external link is clicked is to have some javascript fire that sends off an AJAX request to your site to tell it an external link was pressed, you then need to have a view that handles that data and inserts it into the DB. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---