Your first option is probably being tracked anyway but you can control the exact tracking you need. Documentation is at Tracking API and Tracking Guide.
I would look at the trackEvent call.
On my site I use Sencha’s EXT-JS. In my router code I have:
The first line sets the current userid (Which I get from the cookie the user logs in with). The second line sets the document title to the correct “Page”. The third line actually calls the tracking code.