Your friendly marketer is interested in the beginning and the end of a visitor’s visit. She wants to know where they came from, how long they were around, how many pages they saw and so on.
How do we technically determine those two important moments?
The Beginning of a Visit
Let’s look at the start first. (D’uh. Obviously.)
HTTP is a stateless protocol, so how do we know that a request for a specific page is the first in a visit?
Well, we sort of don’t. But we can use two mechanisms to help:
- Time — if there was a previous request from “the same person”, “not too long ago”, then we guess this is not the first request. More on time later when we look at the end of a visit.
- The HTTP Referer header — the HTTP Referer tells us where the browser came from, allowing us to see whether it was our own site or another.
Funny enough, those methods are anything but water-tight. But that doesn’t mean our friendly marketer wouldn’t want ot use them. She still wants to know where people came from when they enter your site, and the HTTP Referer is a good place to start.
One problem: since there is an HTTP Referer on every GET, we’d in most cases see our own site at the top of any list! So we need to add the concept of an “internal URL”, a URL that belogs to our site and should therefore not be considered an external link.
You can tell Adobe Analytics which URLs are considered internal. Go to the Report Suite Manager under Admin Tools. Select one or more report suite(s), then go to Edit Settings > General > Internal URL Filters.You can now add one or more URLs that the system should treat as internal.
Note: those URLs can be complete URLs or just parts. The system will simply match what you typed to the URL in the HTTP Referer header.To make one thing perfectly clear: this setting only applies to visit starts! That means: reports like Referring Domains, Search, everything under Traffic Sources, basically.
The end of a visit is even harder to detect than the beginning. Technically, nothing happens when a visit ends, at least nothing that our web server would get any wind of.
A visitor might close the tab or their browser. They might switch off their machine or close it. They might run out of battery or move into an area that has no network. They might even leave their machine at their desk and go for lunch or have a chat.
Some of that might be detectable, but web analytics vendors have at some point looked at all those scenarios and decided “nah, let’s work with a timeout. 30 minutes? Sounds great, let’s do it!” So it became an industry standard.
So the timeout doesn’t really concern you as a developer, and that’s probably a good thing.
People clicking a link off site does, though. If on your site there are links that point to others, your marketer will want to know about visitors going there.
Fortunately, tracking this is really easy. In fact, it is almost out-of-the-box. All you have to do is configure it in the configuration section of the
Exit links are links on your site that transport the visitor off the site and somewhere else. Two variables configure how Adobe Analytics treats these links:
s.linkInternalFiltersdefines all URLs that are considered internal, therefore allowing the code to see which links are not.
s.trackExternalLinkscontrols whether the code should automatically track those or not.
The list in
s.linkInternalFilters is a list of substrings of URLs which will be matched against the href parameter of any link clicked on the page. If the URL does not match, the system tracks the click as an “Exit Link”.
Fun fact: if you put a “.” into
You might have noticed that the two settings are only loosely related to the beginning and the end of a visit. Bonus points for that.
As we said: your marketer likely doesn’t care that much. He might not even understand the difference. But he definitely wants to know where people came from and whether they clicked any off-site links. And that you can find out with the help of the two settings we discussed.
I think it goes without saying that the URLs in both places should be the same. There is only very few use cases for having different URLs, in fact I can think of none.
We should also mention a special case: off-site payment systems.
If in your checkout process, your site directs people to paypal or any other payment site before receiving them back for some confirmation page, make sure you add the URL of your payment provider to both places!