# Count views of document

**URL:** <https://community.bloomreach.com/t/count-views-of-document/1724>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [February 3, 2020, 8:03pm UTC](https://community.bloomreach.com/t/count-views-of-document/1724 "2020-02-03T20:03:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pekala](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/pekala/32/249_2.png) [@pekala](https://community.bloomreach.com/u/pekala)\
**Post date:** [February 3, 2020, 8:03pm UTC](https://community.bloomreach.com/t/count-views-of-document/1724/1 "2020-02-03T20:03:46Z")

</div>

Hi,

What I want to achieve: I have a template which shows automatically the content of one document (like an article). Now I want to count the views of the article. Is there a feature or any other possibility to count how often a document was opened?

That would be great.  
Peter

---

<div class="post-metadata">

**Author:** ![jasper.floor](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jasper.floor/32/28_2.png) [@jasper.floor](https://community.bloomreach.com/u/jasper.floor)\
**Post date:** [February 7, 2020, 12:17pm UTC](https://community.bloomreach.com/t/count-views-of-document/1724/2 "2020-02-07T12:17:27Z")

</div>

You’d need to implement a counter, which can be done server side in a component. You may want to have something to detect if its a repeat visit to that page. Analytics tools are usually the way people do this, rather than implementing it in a component.

---

<div class="post-metadata">

**Author:** ![pekala](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/pekala/32/249_2.png) [@pekala](https://community.bloomreach.com/u/pekala)\
**Post date:** [February 7, 2020, 6:21pm UTC](https://community.bloomreach.com/t/count-views-of-document/1724/3 "2020-02-07T18:21:25Z")

</div>

Hi and thanks for your answer.  
What I want to achieve is to show the amount of views of articles in the website. So I cant realize it with a tracking tool.  
So I have to realize it with a component. Where should I save the views? Due the fact that the Website is running on On Demand 1 I cannot connect an external db. Should I save the views into the articledocument? And does this solution work if multiple people are viewing the article simultaneously?

Peter

---

<div class="post-metadata">

**Author:** ![jasper.floor](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jasper.floor/32/28_2.png) [@jasper.floor](https://community.bloomreach.com/u/jasper.floor)\
**Post date:** [February 10, 2020, 9:28am UTC](https://community.bloomreach.com/t/count-views-of-document/1724/4 "2020-02-10T09:28:08Z")

</div>

You can implement it in a component. Saving it on the document is probably a good choice for this case. You will have to consider how to handle repeat visits from the same client. Multiple views are probably not a big problem. In theory two people could be trying to view the article at the same time and have a clash with updating, so you may want to write some code to handle that. How likely that is depends on your traffic.
