Search
Close this search box.

Time spent by Traffic Source

Time Spent by Referring Domain can be quite useful when reporting in SiteCatalyst. Check out our tips to get it working.

One of the things that’s not “native” to SiteCatalyst reporting is Time Spent by Referring Domain, which can be quite a useful segment to use.  So here’s a quick tip to get it working.

The report below shows the end result; Time Spent by Traffic Source (a new custom insight prop).  The entry marked as “direct” are visitors that had no referrer string.

time_by_referrer

Time Spent is enabled by pathing a traffic prop (custom insight).  So to get Time Spent by Traffic Source you need to do a couple of little things.

Step 1 – Create a Prop

In the admin, create a new traffic prop and an eVar (if you want conversions by this too).  I named mine Traffic Source (p) and Traffic Source (c) – just to not confuse them with the native Referring-based reports.

Then ask Client Care to enable pathing on the traffic prop.

Step 2 – Modify your s_code

The following snippet of code should be added into your s_code, along with all of your other rules.  I’ve used s.prop7 and s.eVar16 for my new Traffic Sources reports.

[javascript]
/* Set persisting referrer */
if(document.referrer){
s_trafficsource = document.referrer.split(‘/’)[2]; //get the host
if(s_trafficsource != window.location.host){
s.prop7=s.getAndPersistValue(s_trafficsource,’s_referrer’,7);
s.eVar16 = s.prop7;
} else {
// same referrer as site
s_prop7=s.getPreviousValue(s.prop7,’gpv_ref’);
s.prop7=s.getAndPersistValue(s.eVar16,’s_referrer’,7);
s.eVar16=s.prop7;
}
} else {
// no referrer – so direct
s_trafficsource = “direct”;
s.prop7=s.getAndPersistValue(s_trafficsource,’s_referrer’,7);
s.eVar16=s.prop7;>
}
s.prop7=s.getAndPersistValue(s.eVar16,’s_referrer’,7);[/javascript]

You’ll see from the above that it also uses the getAndPersistValue and getPreviousValue plugins.  If you don’t have them they are available for download through the Help section of SiteCatalyst.

Basically, if there’s a referring domain, it’s initially set and persisted through the getAndPersistValue plugin.  Then it’s passed from page to page via the combination of getPreviousValue and getAndPersistValue.

For those that don’t have a referrer, then it’s just set as “direct” initially and then persisted.

And that’s all there is to it. The pathing reports that this enables actually don’t show too much so you might want to disable them (they do show multi-traffic sources during the same visit though).

The content and advice contained in this post may be out of date. Last updated on December 4, 2011.

Contact us

to discuss a range of services and support to suit your business needs and goals.

* Required field

Latest Blog Posts

Need Some Help?

We can work onsite or remotely with you and your team to provide capacity uplift or ongoing support as you need.

Need additional MarTech resources to supplement your team for special projects or to provide given expertise?

Data quality and integrity is key to any data strategy. We undertake audits and health checks that can give you peace of mind.

If you know your data could be working harder, but you’re not sure where to start, we can help.

We can help you build dynamic dashboards based on important metrics to fully inform the business.

Is it a CDP or a DMP that is right for your organisation? Let us help you work through the pros and cons.

Let us show you how to bring your online and offline data together to create a best picture of your customers.

Free assessments

Martech Talks: The End Of Cookies

This webinar was recorded in May 2024.

Note that the information contained in this presentation should not be taken as legal advice. Digital Balance and its partners recommend that you undertake your own legal investigation.

Martech Talks: The Four Stages Of Attribution Excellence

This webinar was recorded in April 2024.

Download the full 2024 Digital Experience Benchmarks report from Contentsquare.

Note that the information contained in this presentation should not be taken as legal advice. Digital Balance and its partners recommend that you undertake your own legal investigation.

Martech Talks: The Four Stages Of Attribution Excellence

This webinar was recorded in October 2023.

Note that the information contained in this presentation should not be taken as legal advice. Digital Balance and its partners recommend that you undertake your own legal investigation.

Martech Talks: Privacy and Data Governance

This webinar was recorded in August 2023.

Note that the information contained in this presentation should not be taken as legal advice. Digital Balance and its partners recommend that you undertake your own legal investigation.

Martech Talks: Privacy Changes and Data Security

This webinar was recorded in July 2023.

 

Note that the information contained in this presentation should not be taken as legal advice. Digital Balance and its partners recommend that you undertake your own legal investigation.