Skip to main content
You are viewing the documentation for Interana version 2. For documentation on the most recent version of Interana, go to


Scuba Docs

Explorer Guide: Build smarter queries with named expressions

This applies tov2.25

Interana’s behavioral analysis is based on several types of behavioral “building blocks” that we call named expressions. These are not pre-computed but are user definable and re-usable - and can build on one another.

By “re-usable,” we mean that you define a named expression once, and then you can use it in any of your queries.


Metrics calculate summary statistics on any values in sets of events for filters, time periods, actors’ journeys, sessions and more. There are two types of metrics you can create: per-actor metrics and custom ratio metrics.

Per-actor metrics

Per-actor metrics calculate how many times an event occurs during a specified period of time. Use per-actor metrics to define and name a measurement for each actor, such as the number of times they performed an action. You can use these in the Measure field to understand characteristics of different actors, or in filters to compare different subsets of actors based on ad-hoc criteria.

For example:

  • How many times per day callers hang up while waiting on hold
  • Number of users active out of a 7 day period
  • Number of unique products a user has viewed over the last year

Like all named expressions, you can define a metric once and then use it in any of your queries.

Let's take a look at the metric. Click the name of the metric in the list, or the compass icon, and Interana will run a query using the metric with an appropriate View: 

Custom ratio metrics

Another type of metric that Interana supports is a custom metric defined over the entire dataset rather than on a per-actor basis. These metrics can also be defined as ratios, which are often more meaningful for behavioral analytics.

As with per-actor metrics, you can define ratio metrics for events that occur during a specified period time. Unlike per-actor metrics, a ratio metric divides the result of one measurement by the result of another measurement. When the numerator represents a subset of the denominator, the result is a percentage.

Let's take a look at the metric. Click the name of the metric in the list, or the compass icon, and Interana will run a query using the metric with an appropriate View: 

For example:

  • New users who signed up this week versus those who signed up last week
  • Emails opened versus emails sent per month, on a rolling basis
  • Users who consumed a particular resource after viewing a webpage, compared to all users who viewed the page

One limitation of ratio metrics is that you can’t use them in filters.


A Session is a named expression for each actor that divides a sequence of their actions into discrete sub-series of events. Interana sessions are very flexibly defined using arbitrary idle times or restart events — neither one of which needs to defined at the time the events are collected. Sessions provide a powerful tool for understanding how various actors interact with your application, the environment, and each other.

A session is a sequence of consecutive events associated with a single actor. A session is identified as all events that occur during a period of activity bounded by periods of inactivity. For example, you can define a session that restarts after 30 minutes of inactivity. Using this session breaks up events into all activity that occurs before that 30 minute timeout.

Now we come to the most powerful part of Interana sessions — the ability to attach as many custom metrics as you need. The current session has three metrics: Users, Bytes, and Abuse. Each of these are accessible for use as measures or filter conditions in the Explorer, and you can add more using the + link at the bottom:

When you Explore from this session using the auto-generated metrics, Interana returns a graph of the average duration of the engaged sessions:

You can explore sessions to:

  • see the events that happened within a defined session
  • calculate statistics about sessions on the fly
  • change or add session definitions
  • drill down to specific sessions


Funnels are a powerful tool for identifying meaningful sequences of steps that actors take on their journeys through the system. Interana can rapidly compute these funnels across all the actors in the dataset, and calculate useful metrics for each step and the funnel as a whole.

When you create a funnel, you specify steps to match actor journeys against any expected event flow and calculate statistics on how many actors completed each step. Funnels break down actor journeys into sub-series of events. Unlike sessions, they are defined by matching steps (specific events) rather than timeout. Funnels can also be used to find paths to, from, and between particular steps.

Funnels allow you to calculate the number of actors that pass from one state to another as well as the elapsed time between those states. For example, the steps e-commerce shoppers perform during checkout, such as view shopping cart, enter shipping address, enter billing information, and confirm purchase comprise a funnel.

Use funnels to understand the behavior of flows such as registration for an application, actions people take to play a song in an online media player, and various conversion rates like a checkout cart or paywall. The auto-generated funnel metrics allow you to drill into these flows to more deeply understand them.

We can use funnels to look at how Wikipedia deals with deletion of articles. We split up the events in the life cycle of an article as follows:

  • New article (article created)
  • New edit #1
  • New edit #2
  • New edit #3
  • Article hits abuse filter
  • Article is deleted

This gives us the following chart, which shows the drop off between each step (bars in grey) as well as the time it takes between each step (bars in blue).

This tells us that it takes articles a median time of 8 hours and 4 minutes to go from their last edit to hitting the abuse filter.

Funnels are a great way to get insights into:

  • Conversion rates and drop-offs: Use funnels to analyze the conversion rates or drop-offs at each step of a flow. You can view the cohort of entities that dropped off or converted at each step. For example, you can drill down to users who didn't get past step 1, characterize these users, or dig in to understand what might have caused them to drop off.
  • Time between steps: Analyze the time that each actor took between each step in a flow. For example, you can understand how long it took the median user to register after reaching the site, the distribution of time it took to go from level 1 to level 2 in a game, or the time it took users to discover certain features in your product.
  • Events performed between steps: Funnels can show you the events the actor performed between two steps in a funnel. This allows you to understand what actions users took before reaching a step.


Cohorts are a way to group actors that behave in some similar way. Cohorts segment users based on their behavior and attributes within a time period, enabling both behavioral and demographic segmentation.

Interana allows you to define cohorts of actors based on any attribute of those actors, including their journey as reflected in the events stored for them in Interana. You can define a cohort based on whether its users completed a certain sequence of steps in a flow or funnel, whether they did more than a threshold of a certain activity, or whether they had certain attributes in an external database.

These cohorts, like everything else in Interana, are evaluated entirely at read time, so you can get immediate results based on new segments at any time without any reprocessing of historical data. This effectively enables both demographic and behavioral segmentation entirely on the fly.

For example, we can create a cohort of engaged Wikipedia users: 

And then use this in a query to see the number of users in the "engaged users" cohort over the specified time period: 

Use cohorts in Explorer filters to drill down and ask targeted questions about subsets of your actors. For example, you can use cohorts to:

  • Group users by time (all users who logged in during July)
  • Group users by time and shared action (all users who logged in, viewed and commented on an article during July)
  • Group users by time, shared attributes and shared actions (all users who identify themselves as over 6 feet tall and who bought golf clubs during July)
  • Was this article helpful?