Forum Discussion

Haymen's avatar
Haymen
Contributor
9 years ago

How to retrieve Hits per an article based on days

Hi,

 

Lithium tracks the hits per an article since the published date.

 

  1. Can this data be converted to a set time period. Ie. Total hits per an article in the last X days
  2. If so how? 

 

Thanks in advance for your help, 

Haymen

  • DougS's avatar
    DougS
    Khoros Oracle

    REST API V1 has a call to get a count of views for a given message, but there is no way to constrain by date.

     

    If you are ok with just getting a breakdown within a board, rather than a breakdown for a specific article, REST API V1 has a call that lets you get a daily or hourly breakdown of a given metric. You can pass the date_start and date_end parameters to constrain your metric to a given time range. Go to the metrics admin page to find the right metric (the URL will contain the metric key you need to use in your API call as the value of the metrics parameter). You might want tkb_article_views or blog_views (depending on whether its a TKB or a Blog article you are looking for).

     

    -Doug