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.

Be Sociable, Share!


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.”




Be Sociable, Share!

4 thoughts on “Cool Custom Report: Time-to-Purchase within a Visit”

  1. I actually meant scenario. We have services with scenario tagging, where errors can occur in various places. So I use it to tie it back to the latest step in the scenario. (using a 3 dimensional report) scenario name, step and error message.

  2. Hi Nikolaj,

    I’m going to regret saying that! You gave a good pair of examples. For the error message one, I assume you’re talking about something like “most recent value of for all occurrences of error pages”?

  3. Thanks for another good post.

    Why do you say that people don’t use Most Recent Value?

    I use that far more often than first occurence or last occurence.

    Attributing actions to the most recent campaign value
    What was the last step a user saw in a scenario before they recieved an error message etc.
    Anything I need to relate back to the most recent value in the visit.

    To those of you who aren’t familiar with Most Recent Value, I can inform that it sometimes does not show up when you create a new dimension. In that case, save the dimension as all hits, go back and edit the dimension, and now most recent value will be available.

  4. It took me a minute to get how to do this, but it’s very cool. It’s too bad it requires “Most Recent Value” because that choice isn’t available on any dimension besides Query Parameter as far as I can tell.

Leave a Reply

Your email address will not be published.