Funnels: Evaluate data from a series of related events

With NRQL, you can use funnels to evaluate a series of related actions. A NRQL funnel allows you to ask, “Of the people that did step A, how many also did step B, and of the people that completed steps A and B, how many also completed step C?”

For example, at New Relic, we could use funnels to track the number of users who completed these steps:

  1. Visited the New Relic Insights marketing page.
  2. Signed up for an Insights account.
  3. Created a dashboard.

Funnel query structure

Here's the structure of a simple NRQL funnel query:

FROM DATA_TYPE 
  SELECT funnel(AN_ATTRIBUTE, STEP_A, STEP_B) 
  SINCE TIMEFRAME

See a more complex funnel query example.

Funnel queries require the funnel function, an attribute to funnel, and at least two steps:

  1. The first step is the anchor step, which will always represent 100% of the results.
  2. The second and later steps describe the number of users who advance along each step towards the goal. This number typically will be less than 100%. However, it could be 100% if every user who completes (A) also completes (B).
Technical details Comments
Order of steps The order of steps completed is not enforced. In funnel query results, the second or third steps may have been completed by users before the first step.
Attributes Funnel queries can be run on only a single attribute at a time.
Unique values For funnel queries that inspect more than 256 unique values, the results are approximate, for performance optimization reasons.
Maximum steps You can have a maximum of 10 steps within a funnel query.

For more information, check out the New Relic University tutorial Funnel queries. Or, go directly to the full online course Writing NRQL queries.

Funnel query example

This example queries the New Relic Browser PageView event and its attributes. It queries unique browser sessions that have gone from registering to upgrading their account. Labels are included for each step, indicated by the keyword AS.

FROM PageView SELECT funnel(session, 
    WHERE pageUrl='http://www.storefront.com/signup' AS 'Email Sign Up', 
    WHERE pageUrl='http://www.appproduction.com/basic_feature' AS 'Feature Compare', 
    WHERE pageUrl='http://www.appproduction.com/advanced_feature/upgrade' AS 'Upgraded Account') 
    SINCE 12 hours ago

This query returns the following:

Screenshot of funnel function
An example NRQL funnel query that displays a count of the users who registered for an account, visited a feature-compare page, and finally upgraded.

Include additional steps inside the parentheses of the funnel function in a comma separated list:

SELECT funnel(session, 
    WHERE name='Controller/about/main' AS 'Step A', 
    WHERE name = 'Controller/about/careers' AS 'Step B', 
    WHERE name = 'Controller/about/insights' AS 'Step C', 
    WHERE name = 'Controller/about/apply' AS 'Step D') 
    FROM PageView 
    SINCE 1 week ago

For more help

Recommendations for learning more: