# Funnel(Conversion) analysis(Metrics)

**URL:** https://discuss.elastic.co/t/funnel-conversion-analysis-metrics/24899
**Category:** Elasticsearch
**Created:** [July 4, 2015, 3:46pm UTC](https://discuss.elastic.co/t/funnel-conversion-analysis-metrics/24899 "2015-07-04T15:46:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nikhil](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@nikhil](https://discuss.elastic.co/u/nikhil)
#### Post date: [July 4, 2015, 3:46pm UTC](https://discuss.elastic.co/t/funnel-conversion-analysis-metrics/24899/1 "2015-07-04T15:46:49Z")

</div>

Hi there,

I really liked the way the elastic search aggregation query works and interested to use it for one of the product.

We are planning to have a funnel analysis or conversion metrics in our product using elastic search.

I went through the docs but having a hard time to locate any query.

Example data:  
{  
[  
{"user\_name": "john", "event\_name": "A", "date": "2014-08-04"},  
{"user\_name": "peter", "event\_name": "A", "date": "2014-08-04"},  
{"user\_name": "john", "event\_name": "B", "date": "2014-08-05"},  
{"user\_name": "peter", "event\_name": "C", "date": "2014-08-09"},  
{"user\_name": "john", "event\_name": "C", "date": "2014-08-06"},  
]  
}

Need the query where we can trace john followed the steps in sequence whereas peter has not.

Any help would be really appreciated.

---

<div class="post-metadata">

### Author: ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)
#### Post date: [July 5, 2015, 5:52am UTC](https://discuss.elastic.co/t/funnel-conversion-analysis-metrics/24899/2 "2015-07-05T05:52:37Z")

</div>

Tracking behaviours over time typically requires this approach: [https://www.elastic.co/videos/entity-centric-indexing-mark-harwood](https://www.elastic.co/videos/entity-centric-indexing-mark-harwood)

---

<div class="post-metadata">

### Author: ![nikhil](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@nikhil](https://discuss.elastic.co/u/nikhil)
#### Post date: [July 6, 2015, 9:59am UTC](https://discuss.elastic.co/t/funnel-conversion-analysis-metrics/24899/3 "2015-07-06T09:59:28Z")

</div>

Thanks for the reply.

We need to have Retroactive funnel analysis where the data is logged and the user can come in and decide to create a funnel on the previous logged in events.

---

<div class="post-metadata">

### Author: ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)
#### Post date: [July 6, 2015, 10:10am UTC](https://discuss.elastic.co/t/funnel-conversion-analysis-metrics/24899/4 "2015-07-06T10:10:46Z")

</div>

With some creative encoding of data you could use the equivalent of a Phrase query to check the sequencing of events.  
In the normal use case, phrase queries might be used to detect the words "quick brown fox" appear in sequence in a text.  
In your scenario it might be used to detect tokens "homePage, ProductFooPage, PurchaseFoo" occur as a sequence in a user profile summary.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 12:03am UTC](https://discuss.elastic.co/t/funnel-conversion-analysis-metrics/24899/5 "2017-07-06T00:03:27Z")

</div>


