Is referrer reported by browser stored anywhere?


#1

Why is a little complicated… but it benefits me to know the URL actually submitted by a user’s browser as the referrer during an action.

Some digging indicates that:
[ul]
[li] PiwikTracker.php sends the value as &urlref
[/li][li] The log_visit table has referrer information, but it only stores the first action of the entire visit
[/li][li] The log_link_visit_action table has referrer information captured in idaction_url_ref and idaction_name_ref
[/li][li] However, according to the description of Action.record(), idaction_url_ref is “the ID of the last action done by the current visit”
[/li][/ul]

Is the actual referrer reported by the browser stored anywhere?

If not, can I change a setting to rely on the browser reported value instead of automatically using the last page?

If not… and assuming that I’m happy to dump the information off in a random table (manually JOINing later), is it difficult to record information like this via a plugin?


(Matthieu Aubry) #2

We only store referrer for the first pageview of the visit. If you need referrer for all pageviews, it needs to be recorded in a new column ie. via a new custom plugin. What’s your use case?


#3

The question arose while prototyping an email tracking system. I wanted the ability to detect a link that had been reposted to a website since these clicks are no longer likely to be the email recipient. I managed to (temporarily) get around this issue by forcing a new visit as part of the logical flow (and you just reminded me to submit that pull request).

In general, however, I’d hate to lose the data. For example, if I wanted to capture every single page that links to a website, I wouldn’t want to miss an inbound link just because a user was in the middle of a visit (e.g. had found the site in the midst of research and returned from a second source).


(Matthieu Aubry) #4

there is actually a great way to store the referrer per page! I didn’t think of it in my previous answer. The solution is to use a Custom Variable of scope ‘page’.

Then the referrer URLs can be seen in the Visitor Log, Visitor profile, etc.