Cool Custom Report: Time-to-Purchase within a Visit

Total length of visit is nice, but how-long-before-the-purchase is the more valuable piece to measure. Try this Webtrends trick.


All analytics tools can tell you about length of visit.

But maybe you want to know the time, within an average visit, just until the purchase action.  Or a basket add.  Or the first product page view.

pre post purchase report2

If you’re spending a lot of energy making the site super-navigable then OF COURSE  you want to see if all that work is making a difference and one good measure is how long it takes the visitor to get to a key point.  

Personally, I wish certain sites out there would care how long it takes me to submit an order for something pretty simple.  I won’t mention names, but, really, you fast food people …. stop wasting my valuable time!   Especially if I am a repeat customer!   (Yes, I know that certain FF sites are making great strides in ease of ordering.  I wonder if the others just don’t know how long it takes.  They need this report.)

Sure, you could potentially use length of  visit as a rough estimator of time-to-order.   But if site visitors commonly hang around after their purchase — for example, watching their order getting cooked in the case of fast food sites — this doesn’t work.  Or, if you just want to know how long it takes people to get down to the product page level, visit length definitely doesn’t help.

pre post product page

Well, you CAN get time-to-event with Webtrends.  Not all sites are constructed in a way that allows it all the time (see below), but many do.

Here’s an overview of how to do it:

  1. you’re going to create a custom dimension consisting of only two rows:  all the hits before that important action, and all the hits after that action.  (You’ll care only about what you see in the “before” row.)
  2. Then you’re going to create a report that shows results only for visits that included the crucial event.
  3. In that report, you’re going to use that before-pages and after-pages dimension, and look at these measures:  a) the total number of seconds spent on all of the before-pages, b) a count of visits containing before-pages, and  c) the average minutes per visit.
  4. “c)” is your payoff – it’s average time-to-event in an average visit that contains that event.

(You might ask why #1 is done with a dimension instead of just a filter for “before-event” pages.  Well, if you can think of a way to do that, let me know!)

Here are detailed steps for implementation in Webtrends.

  1. The most important thing is to decide which page view (hit) contains your targeted action.  Once you’ve done that, you must then identify a query parameter in that hit that isn’t in any of the previous hits in the visit.  Examples may help:
    • Example 1: Confirmation page for a purchase or download.  Your identifier could be the parameter WT.tx_i=.   No visit hit has WT.tx_i in it until the point of purchase confirmation, right?
    • Example 2: First product page view.  Your identifier could be productid= or WT.pn_sku= as long as no visit hit contains that parameter until a product page is seen.
    • Example 3: First use of Store Locator.  Your identifier could be location= as long as, until that point in a visit, no hits contain that parameter.

pre post storefinder 2

    • Example 4: Log-in action.  Your identifier could be LoginID=, as long as it’s a parameter that only appears once you have logged in.
    • Example 5: Used on-site search.  Your identifier could be WT.oss=.
    • Getting the idea?  Please note – you might pick a targeted on-site action whose URL does NOT contain a query parameter that is seen for the first time right then when the action takes place.  If so, you are stuck and can’t do this cool report.  We have tried to find ways to do this trick with specific values of a parameter, or specific URL stems, but we can’t make it happen, even with dimensional filtering using match fields.
  1. Create a custom dimension that will separate hits before this page from hits after.
    • Go to Custom Reports > Dimensions and start creating a new one.  Name it something like “Hits Before and After xxxxx”.
    • Based On should be Query Parameter, then the name of your all-important parameter.
    • While you’re still in the Based On tab, click on Advanced, check the “Override Default String” box, and next to “New String” enter a good name like “Pre-xxxxxx hits”.  (All you’re doing is renaming the “None” row to something more meaningful.)
    • When To Collect Data should be Most Recent Value.  (I’ll bet this is the first time you’ve used this choice, even if you’ve made custom dimensions before.)  Not First Occurrence, not Last Occurrence, but Most Recent Value.  Important.
    • Finish and Save.
  2. Create a custom visit filter that will include only visits that actually contain your target event at some point in the visit.  There are a lot of ways to do this.  One slightly elaborate way would use the targeted parameter you identified in Step 1.  This way, you don’t need to bother with the main URL, just the parameter name.
    • Go to Custom Reports > Filters and start creating a new one.  Name it something like “Visits that contain xxxxx”.
    • Make sure it is a Visit filter, not a Hit filter (radio buttons below the filter name box).
    • Create a New criterion.  Filter On should be “URL Viewed In Visit”.  Page Expression should be Equal to “*” (asterisk).  Do not check the Regular Expression box.   Then click on New URL Parameter and enter your parameter name, Equal to “*” (asterisk).  Make sure the matching type is Text.  Finish by clicking on Done.
  3. Create a custom report.
    • Go to Custom Reports > Reports and start a new one.  Name it something like “Pre- and Post-xxxxx Time”
    • In Dimensions, choose your new dimension.  Do NOT check the “Exclude Activity Without Dimension Data” box – that will remove your all important “None” row that’s the focus of this whole effort.
    • In Measures, implement Visits and View Time (sec) which you’ll find in the Standard Measures section of the dropdown list.
    • Also, in Measures, create a Calculated Measure.  Name it something like “Average Minutes. ” Type should be Numeric and Decimal Digits should be 2.  In the formula area, enter (by dragging and dropping) “View Time / Visits / 60”
    • In Filters, apply the filter you created in step 3.
    • Finish and Save.

That’s it.


In your report, you’ll see a row called “Pre-xxxxxx hits” (see step 2 above; this is the “None” row that you gave a new name to).  That’s the ONLY row to pay attention to.  The other rows will contain various values of your target parameter … but they are all hits that happened after your target event.  Ignore ’em.

Are you getting the idea that the only hits we care about are those that don’t have a previous instance of your target parameter?  These are the “befores.”




Reasons for Seeing Your Own Site As A Top Referrer – And What To Do

Have you noticed that your own site is a top referrer for itself? It’s messing up your conversion numbers, and here’s what to do about it.


On the all-important Referrers reports (Referring Domain, Referring Site, Referring Domain Type, and Referring Page), there are always two puzzling entries –

  • the Direct Traffic item (see this post about Direct Traffic)
  • the listing for your own site

How can you be seeing visits referred from your own site?  More importantly, what should you do about it?

The main reason is easy to understand once you “get” what a visit really is in the analytics world.  (See the Postscript for another possible reason that hopefully don’t apply to you.)

First, think about this.  Get inside your visitor’s head for a second….

When, exactly, is the visitor really done with your site?  When is the visit really over?

  • When they click on one of your links that goes off-site?  What if they come back right away?
  • When they type something else in the browser window?  What if they come back a couple minutes later?
  • When they close the browser window?  What if they have your site open in more than one window? 
  • When they back-button to the search engine window that brought them there in the first place?  What if they come back to your site with another click on your listing?
  • When they switch to a different tab in the browser?  What if they come back to that tab?
  • When they leave your site open and go to a meeting?  What if they start clicking again when they return to their desk?

Get the picture?

My question to you is:  do you agree that the visitor is done with your site when they “leave”?  Is the visit really over?

Not to me.  For most of the sites I deal with, these scenarios are describing what I think, (and what I think the visitor thinks …) is one visit.

Empathize with the WebTrends program for a second.

It’s chunking along, assigning each hit to a visit (using a cookie, for example), and keeping track of all these open visits while they’re happening.  It (the WebTrends program) has no way of knowing when a visitor is done with their visit.  None!   It cannot tell when a different site fills the browser window or when the browser is closed by the visitor.

WebTrends’ can only ASSUME a visit is over when it sees a long period of nothing happening.

Consequently, WebTrends has a time-out setting.  If x number of minutes go by without any file requests, WebTrends marks the visit closed and adds that visit’s various stats to various internal tables.

Out of the box, WebTrends’ visit timeout is 30 minutes of inactivity.   So if somebody leaves a page sitting on their screen for 31 minutes, then they come back to the page and click on something, that new click will be the bucketed as the first click of a new visit.

And in this particular instance, the referrer, i.e. the page of origin of that click is …. one of your own site pages!

That’s the explanation of what’s happening.  Why should you care?  Because it’s screwing up your visit conversion numbers, is why.

  • Your total visits number is bigger than it actually is.  This is the all-important denominator for your site conversion metric (conversion visits divided by total visits).    In other words, your reports are showing inflated visit counts, and deflated conversion percentages.
  • Your campaigns aren’t getting credit for some conversions.  Instead, the credit for some conversions is going to your site.

If you want to be one of the analysts who adjusts for this distortion of the facts, here are some possible ways to deal with it.  (This is why they pay you the big bucks.)

  1. Adjust your mental label.  Start thinking of the self-referred visits as “visit second halves.”  “Self-referred visits” is not a good label because it implies that they really are visits.  To me, they’re not.  They’re just visit pieces.
  2. Adjust your stats.  You get a “visits” number from the Overview Dashboard and various places, but is it really the number you want to use?  A much more accurate visit count is the total visits number MINUS the second halves.  In other words, [number of visits (from Overview) minus visits referred by your own site (from Referrers)].  Yes, if you do this arithmetic, your total visits number goes depressingly down.  But at the same time, the size of a typical visit goes up!  And ratios like “percent of visits with a conversion” goes up also.  (Note that you’ll have to do these adjustments to your stats outside of WebTrends, for example in your Excel exports that are your final deliverable to your end users.)
  3. Realize and accept that your campaign attributes will underestimate conversion because of this.  The reason: if the campaign attribution happens in the first visit (the landing page), and the conversion happens after the visitor’s pause in activity, the conversion can’t be connected by WebTrends to the campaign.
    • Well, there’s one way — set up your campaign reports to use Most Recent Campaign.  Unfortunately this will connect some conversions to old campaigns, and if you’re interested only in campaigns that your visitors experienced very recently, you’ll need to look at short timeframes, like a day or two.
  4. If you are lucky enough to be using Webtrends On Premises, fix just about everything by changing WebTrends settings to reduce the number of second halves, i.e. merge as many second halves as possible with their first halves.  You need the software to do this; you cannot do it with On Demand. The setting that does this is the timeout.  The underlying principle is that the longer the timeout, the fewer visits will be split in pieces for timeout reasons.   Make sense?  Good.
    • The timeout is configurable by you for a given Session Tracking choice — in the Session Tracking area (Web Analysis >> Options >> Session Tracking >> General tab).  You can set up several different Session Tracking definitions, each having different timeouts, because different profiles may need different timeouts.  For example, if you really really need to have your WT stats on the same basis as other analytics programs, you’ll want at least one profile that uses 30 minutes.
    • I, personally, set my timeouts to be 90 minutes, simply because my mental model of a visit allows the visitor to take a lunch break or have an hour-long meeting.
    • Some analysts prefer 2-4 hours
    • WebTrends has no maximum, but the higher you set it, the more likely it is that WebTrends will break because it has to keep more and more visits in memory at one time.


There is another reason for seeing your own site as referrer if you use SDC tags for data collection.  What if a visitor arrives on a page that doesn’t have an SDC tag?  Any clicks going from that page to the rest of your site will be recorded as originating on that un-tagged page.  The un-tagged page won’t appear in your reports at all, and the actual SECOND page view will be (incorrectly) shown as the entry page.  And, that untagged page will be recorded as the referring page, i.e. the referrer will look like your own site.

This will happen even if the un-tagged page contains an automatic redirect to the second page.

One way to check on this is to look at a report on “Referring Pages” (not Referring Sites or Domains) — look for any of your own site’s pages that are listed as referrers but don’t show up in the Pages report.

The solution is:  tag that entry page!

Postscript 2:

Don’t try to solve the problem of split visits by filtering out visits that are referred by your own site!  Although it’ll appear that you’ve tidied up the referrers report and fixed your total visits number, the rest of your data will be a mess.  Any KPIs that happen during second halves won’t be reported on.