Tracking site information
Sometimes, we want to track where users have come from, or capture other information about them as they move around the site. This may be to customise what we show them, or to build up our knowledge of how the site is used in some way.
We've seen some parts of this earlier in the book and in this recipe, we'll revisit some of that content.
Getting ready
Nothing special is required; these techniques will work with any form.
The recipe below looks at several different ways that you might want to track your user. Pick out the one (or maybe two) that will be most useful to you.
How to do it...
1. If you need to track the user
Fortunately, Joomla! makes this very easy for us as Joomla! does the basic tracking. When you visit a Joomla! Site, a "session" is created that contains some personal identifiers. This follows you as you browse the site until the current visit ends.
Among the information saved in the session is the Joomla! User ID, which in turn, lets us access the...