A sneak peek of segmenting based on historical data in Episerver Insight

Yes, we are going to enable segmenting based on historical data. See below how you can do it soon.

Today: Segments based on profiles

Insight users have 2 options for creating segment based on profiles data: using filter in Insight UI and defining OData-like queries using Profile Store API. Please find more information about managing and using segments in this blog post.

What was missing

Combination of methods above enables segmenting using profiles data. The problem is that most of information that we track is not available when querying profiles.

All that historical data, visitor actions, clicks, behavioral patterns, transaction, everything that visitor has done is spread in millions of events that our customers track every day. So far there was no easy way to analyze this information and use for segmenting.

Right now, we are working on the solution to enable segmenting based on historical data, so prepare to start playing with it.

Enabling developers to analyze the events data

In general, we have no idea what customers track. Developers can submit custom events or put any custom data into Payload property of tracking events. Instead of trying to guess what it is, we want to let developers to decide how this information can be used. They implement tracking, so developers know exactly what their event data means.

Using KQL to query events

First, we enable querying and analyzing events using KQL (Kusto Query Language). It should be familiar to many developers who work with Microsoft Azure. This is what you may already use in queries when digging in your Application Insights and Azure Monitor logs. Check out all cool features that you get with KQL.

Here is a simple example of finding high value customers, who made most of transaction using Profile Store API:

POST /TrackEvents/preview
Authorization: epi-single ************
Content-Type: application/json-patch+json
accept: application/json

{ 
    "Query": "Events
        | where EventTime between (todatetime('2019-01-01') .. endofday(now()))
            and EventType == 'order'
            and User.Email != ''
        | summarize Count = count() by DeviceId
        | where Count >= 5", 
    "Scope": "MySite1" 
}

Introducing filter definitions

When developer has an interesting query, it’s time to create something that we call filter definition. It is a reusable query template with the set of parameters. Here is how you do it using Profile Store API:

POST /FilterDefinitions 
Authorization: epi-single ************
Content-Type: application/json-patch+json
accept: application/json

{ 
    "Name": "TopOrders",
    "Description": "Customers who have made number of purchases during certain time",
    "Category": "Transactional",
    "Type": "Events",
    "Query": "Events
        | where EventTime between ({{startdate}} .. endofday({{enddate}}))
            and EventType == 'order'
            and User.Email != ''
        | summarize Count = count() by DeviceId
        | where Count >= {{numberoforders}}", 
    "Parameters": {
        "startdate": "datetime",
        "enddate": "datetime",
        "numberoforders": "int"
    }
}

You can see the same query and defined list of parameters (startdate, enddate and numberoforders) that should be used instead of {{placeholders}} when executing the query.

Creating segments based on historical data

Now marketers can take over and start segmenting profiles based on filter definitions. We have a new UI for that:

Creating a segment based on filter definition

Marketer selects available filter definition in the left pane and inputs parameters values. Now it is not a template anymore, specific values make it a segment. In this example, we want to group customers who have placed 5 or more orders from the beginning of the year.

Marketer can play with parameters and preview matching profiles. After all, marketer defines the segment name and description and clicks the Save button. New created segment can be found under Segments section in Insight UI:

Segment based on historical data i Insight UI

Now the segment can be used in the same way as any other Insight segment: personalization, engagement with users or using segmented profiles in your custom integration.

Couple of examples of segmenting based on events

Just imagine how much cool stuff you can do for these visitors:

  • Visitors who have bought specific product during period
  • Users who have ever opened any campaign email
  • Visitors with abandoned carts today
  • Happy customers who smiled on cash desk in your offline store

To summarize

  1. We enable developers to create templates (filter definitions) to analyze and query event data in any way they want.
  2. We enable marketers to create segments based on re-usable filter definitions and group visitors based on tracked statistics.
  3. Advanced segmenting on historical data provides massive insights and can be used for content personalization and Commerce discounts using visitor groups and messaging visitors using Intelligent Campaign.
  4. Profit!

When it is available?

We hope to make new segmenting available for all customers in Q4.

Stay tuned

More details and information will follow. Also please come to the closest Episerver Ascend conference to see more!

2 thoughts on “A sneak peek of segmenting based on historical data in Episerver Insight

  1. That looks really useful. Is KQL fully supported or just a sub-set?
    I’m looking forward to getting my hands on it and giving it a try.

    1. @Paul Gruffydd Looking forward to hear how it works for you when it’s GA!
      Query execution is definitely scoped to customer data only. We may have to introduce language features limitation to ensure that complex queries don’t overload the system and don’t stay running for long time. That’s the best answer that I can give right now.

Leave a Reply to Dmytro Duk Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.