# Visualize website usage by users

**URL:** <https://discuss.elastic.co/t/visualize-website-usage-by-users/154754>\
**Category:** Kibana\
**Created:** [October 31, 2018, 6:49am UTC](https://discuss.elastic.co/t/visualize-website-usage-by-users/154754 "2018-10-31T06:49:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueSpirit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bluespirit/32/44056_2.png) [@BlueSpirit](https://discuss.elastic.co/u/BlueSpirit)\
**Post date:** [October 31, 2018, 6:49am UTC](https://discuss.elastic.co/t/visualize-website-usage-by-users/154754/1 "2018-10-31T06:49:10Z")

</div>

**Goal** : I want to create a dashboard which shows user requests made to my website. For this, I created a filter in my java web-app and started capturing user requests and storing them in an ES index. The document is in the form of:  
**{**  
'user': 'user1',  
'url': '[domain.com/page1](http://domain.com/page1)',  
'hitcount': 12  
**}**  
So, now I have an index which contains the information as to how many times a user requested which URLs.  
Now, I want to create visualizations to show usage trends per user.

**Question** :

1. Which visualizations should be used for this use-case?
2. If I need to show the change in user-trends over time, how should I save the data? For e.g. is there a visualization where I could show, that a user has stopped/reduced requesting a page and now accesses a different page more frequently.

Any direction will be helpful.  
**Note** : I understand, this could be done with [grafana + prometheus](https://prometheus.io/docs/visualization/grafana/#creating-a-prometheus-data-source), but I wish to do this with elastic stack.

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [October 31, 2018, 3:51pm UTC](https://discuss.elastic.co/t/visualize-website-usage-by-users/154754/2 "2018-10-31T15:51:16Z")

</div>

hi @BlueSpirit,

that should be fairly easy to do in Kibana.

for (1): you can use the date-histogram to show these trends over timte (bar chart, line chart, ...). You would split by `terms` as a sub-aggregation, where a `term` is the `user`-field. For the metric, select `sum` of all `hitCounts`.

for (2): nest another `term` sub-aggregation for the `url` field, which will group your data for each user for each url. Then, when you filter down to a specific user (e.g. by filtering on the `user`-field for a specific value, you can track the behavior of the user for all pages over time.

---

<div class="post-metadata">

**Author:** ![BlueSpirit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bluespirit/32/44056_2.png) [@BlueSpirit](https://discuss.elastic.co/u/BlueSpirit)\
**Post date:** [November 1, 2018, 6:34am UTC](https://discuss.elastic.co/t/visualize-website-usage-by-users/154754/3 "2018-11-01T06:34:04Z")

</div>

Hi @thomasneirynck,  
Thanks for the reply. Currently, I have bar and pie charts. where splitting criteria is done on _user_ and _url_. Also, I created tag-cloud charts to show top-5 URLs and top-5 users.

Also, should I change the way we store this data. As in, should I save each request individually and then create charts on aggregated data. Only concern is the space it will take.

---

<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:** [November 29, 2018, 6:34am UTC](https://discuss.elastic.co/t/visualize-website-usage-by-users/154754/4 "2018-11-29T06:34:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
