Get page view count using Episerver page view tracking?

Vote:
 

Our requirement is to get the total page view count (E.g. If the user loads the page once, the page count will increase by 1) for each page.

So we have found this Episerver documentation regarding the Page View Tracking. However, it does not state about how to retrieve the page view count. And also it does not mention how to retrieve/show the page view tracking data. Is there a separate report in Episerver to view those or do we need to create a separate report from ourselves?

And if this Episerver Page View Tracking supports page view count, then how can we retrieve the view count of a specific page?

#227739
Edited, Sep 11, 2020 7:47
Vote:
 

Hi Senura

As far as I know, you cannot pull out that kind of data from Episerver Tracking or Profile Store.

Instead you can consider to:

  • Query page requests from Azure Application Insights (or similar).
  • Query page views from Google Analytics (or similar).
  • Implement a custom counter table somewhere (queue the views and flush once a minutes or so).
#227785
Sep 12, 2020 19:31
Vote:
 

Hi,

You certainly can pull page view tracking information from Profile Store though you'll obviously want to consider how to do that efficiently for your use case - I'd suggest some caching rather than querying the API on every page view. I've written about similar here and here though in those articles I'm agregating the data to return the most popular articles on a site over a given time frame rather than just looking at the response for an individual page. The principle's the same though in that you want to query events rather than profiles.

Getting the count for a single page would require a query like this:

[PROFILE STORE URL]/api/v1.0/trackevents?$filter=EventType eq epiPageView and Payload.epi.contentGuid eq [GUID OF THE PAGE]&$top=0

I've set the $top parameter to 0 as you don't actually need to return any results, just the count.

One slight caveat... I'm not sure of the data retention policy for events in Profile Store. I seem to recall hearing that it's not indefinite though I don't know whether that's still correct.

#227872
Sep 15, 2020 10:02
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.