Is there a way I can retrieve the traffic source information from the GA tracker object?
When the user first arrives in the site, the GA tracker does contain the referer information that I get by calling:
trackers[0].get('referrer');
Which by the way, is the same information taken from document.referrer
.
My problem is, if user navigates to a second page in the site, both calls return "undefined".
We know Google Analytics is somehow storing the information for the session.
Can I retrieve, from the GA tracker object, the referrer for that session, not for the pageview, as well as the campaign name/medium/origin/etc which originated the session?
You cannot retrieve that information from the GA object. This used to be possible with older versions of the tracking code that stored a lot of information on the client (reading values from utm cookies used to be a common thing to extract information and channel it into other systems).
With the introduction of Universal Analytics and the Measurement Protocol the data is now evaluated on the server. Google stores the information on the first hit serverside, and then ties the subsequent interactions to the source information using the mandatory client id that is transmitted with all hits.
There is no realistic/scalable way to retrieve that information in realtime so you could use it in your website (one can dream of using the realtime api for that purpose but I doubt one will get a usable solution that stays within the allocated quota).