Moped Documentation
  • Welcome 👋
  • User Guides
    • Getting started
    • Map a project
  • Product Management
    • User communication
    • User management
    • User analytics
    • Local testing
    • Release process
    • Patch release process
    • MUI X Pro License
    • Integrations
      • Dataset documentation
      • ArcGIS Online
      • eCapris
      • Power BI
    • Features
  • Dev Guides
    • DB Docs & Data dictionary
    • Database backup policy
    • Moped Read Replica
    • How-to's
      • How do I start the Hasura cluster locally?
      • How do I launch the Hasura Console?
      • How do I get a JWT token?
      • How to ping the GraphQL API
      • How to ping the REST API
      • How do I connect a database with Postgres GUIs?
      • How do I connect to the RDS instance?
      • How to load production data into a local instance
      • How do I update seed data?
    • Hasura
      • Hasura Roles
      • Hasura Migrations
        • Getting Started
        • Installing the Hasura CLI
        • Configuration Files
        • Hasura Migration Principles
        • The Migration file format
        • Development
        • Hasura Seed Data
        • Running the Hasura Cluster Locally (video)
        • Create a migration: Exercise 1 (video)
        • Create a migration: Exercise 2 (video)
        • Latest hasura-cluster features
    • User Management
    • Authentication
      • Authentication Architecture
      • DynamoDB & Cognito
      • Secrets Manager & Cognito
      • Hasura & Cognito
      • React & Cognito
      • Flask API & Cognito
      • Single Sign-On with CTM
    • Code organization
    • API
      • Configuration Files
      • Testing
      • User Management API
    • Maps and geospatial data
      • Access tokens and API keys
      • Map libraries
      • Map data
      • Map styles
      • Map layers and basemaps
      • React patterns
      • V1 Archive
        • Map libraries
        • Map data
        • Map custom hooks
        • Map styles
        • Map layers and basemaps
    • UI access control
    • Design system
      • Branding
      • Component styles
      • Text content
    • Activity Log
      • Architecture
      • GitHub Actions and Deployment of Updates
      • Hasura Event Logs and Truncate Cron Job
      • Authentication
  • See also
  • Get Moped support, report a bug, or request an enhancement
  • Data & Technology Services
  • Github repository
Powered by GitBook
On this page
  • User event data
  • Querying event data
  • Activity log data
  • Querying activity data

Was this helpful?

  1. Product Management

User analytics

PreviousUser managementNextLocal testing

Last updated 1 month ago

Was this helpful?

We have two ways of tracking user activity in Moped. Edit activities are tracked in the moped_activity_log table, and we also collect certain usage metrics, which are stored in the moped_user_events table.

User event data

There are currently two event types available:

  • app_load - created whenever a user opens Moped in a browser tab, or when the user refreshes the page.

  • dashboard_load - created whenever a user navigates to the page

  • projects_map_load - created whenever a user navigates to the page

  • projects_saved_view - created whenever a user open the saved view modal in the projects list

It would be fairly easy to add additional event types. Ask a dev.

Querying event data

You can connect to the Moped Read Replica database and query usage metrics. For example, this query counts the number of events by user per day

SELECT
    events.user_id,
    first_name || ' ' || last_name AS person,
    created_at::date event_date,
    event_name,
    count(id)
FROM
    moped_user_events events
    LEFT JOIN moped_users u ON u.user_id = events.user_id
GROUP BY
    events.user_id,
    person,
    event_date,
    event_name
ORDER BY
    event_date DESC;

Activity log data

The activity log data can be queried to see user edit activities

Querying activity data

This query retrieves the number of edits by user by day

SELECT
    first_name || ' ' || last_name AS _name,
    count(activity_id) AS num_of_edits,
    created_at::date as edit_date
FROM
    moped_activity_log
    LEFT JOIN moped_users ON updated_by_user_id = user_id
WHERE
    created_at > '2023-11-01'
GROUP BY
    _name,
    edit_date
ORDER BY edit_date desc;
Dashboard
Projects map