Issue: No Per-User Dashboard View Analytics via API

Issue: No Per-User Dashboard View Analytics via API

Context:

  • DHIS2 Instance URL: https://samiksha.piramalswasthya.org/amrit/

  • Requirement: As an admin, I need to see, for a specific dashboard (ID: d6KxtjIw3fl), a breakdown of views by user—i.e., exactly which users viewed the dashboard, how many times each, and in a given period (for example, last month).

  • Why: I want to differentiate usage by admin, dashboard creator, and end users for better adoption tracking.
    What I Tried:

    • Standard API call:
      https://samiksha.piramalswasthya.org/amrit/api/dataStatistics?eventType=DASHBOARD_VIEW&favourite=d6KxtjIw3fl&startDate=2025-07-01&endDate=2025-07-31&interval=MONTH&fields=totalViews

      This works and returns the correct total views for the dashboard and date range.

      However, there is no per-user breakdown in the response—just an aggregate total.

    • Attempting to add or change parameters (e.g., fields=users or using other likely field names) does not provide per-user analytics.

    • Using &username=USERNAME parameter only works for one user at a time, requiring individual calls for each user (not feasible or scalable).

      Expectation:

      • I want a direct way (API endpoint or export) to see, for a given dashboard and period, a list of users and how many times each has viewed that dashboard (e.g., a table with columns: Username, View Count)

        and Even individual userwise views are also not being show
        Piramal Swasthya - AMRIT Dashboards

        Request to Community:

        • Is there any way (API, app, export, widget, or SQL approach) to get a complete per-user breakdown for dashboard views for a given dashboard and time period?

        • Are there any custom scripts, upcoming features, or recommended workarounds for this requirement?

          Sample Response for Reference

          Here’s an example of the output I need:

          Username Views (Jul 2025)
          admin 12
          dashboard01 8
          enduserA 25

{user: “admin”, views: 12}, {user: “dashboard01”, views: 7},{user:”enduserA”,views:25}

Hi @Sandeepnagula

Yes, there is no way to do this with the current API. You should however be able to build a paramaterized SQL view which should provide the information which you need. Have a look at the datastatisticsevent table. This table contains all of the information sent by the client when dashboards are accessed. It also contains the username of the user who sent the request.

Let us know if you need more help! Good luck.

Best regards,

Jason

1 Like