Skip to content

ubc/canvas-page-view

Repository files navigation

Canvas Page View

This project downloads the page views for specified Canvas users and outputs a CSV for each user with the following headers:

  • 'id'
  • 'app_name'
  • 'url'
  • 'context_type'
  • 'asset_type'
  • 'controller'
  • 'interaction_seconds'
  • 'created_at'
  • 'user_request'
  • 'render_time'
  • 'user_agent'
  • 'participated'
  • 'http_method'
  • 'remote_ip'
  • 'links'

An explanation of what these headers mean can be found here: https://canvas.instructure.com/doc/api/users.html#PageView

Getting Started

These instructions will get you a copy of the project up and running on your local machine for use with your own API tokens and Canvas domains.

Prerequisites

  1. Install Node 10 or greater.
  2. Install Git.

Host URL and Token setup

  1. Create a .env file.
  2. Generate Canvas API token and copy it to clipboard.
  3. Add the following: CANVAS_API_TOKEN={YOUR API TOKEN} and CANVAS_API_DOMAIN={YOUR API DOMAIN}. An example CANVAS_API_DOMAIN is https://{school}.instructure.com/api/v1

Installation and execution of script

  1. Clone this repo. git clone https://github.com/ubccapico/canvas-page-view
  2. Then cd into the repo. cd canvas-page-view
  3. Run the installation script. npm install (If you see babel-node: command not found, you've missed this step.)
  4. Add your Canvas user IDs to index.js, as well as the start time and end time, where it says: getPageViewsForUsers([/* add Canvas user IDs */], /* add start date */, /* add end date */)
  5. The start and end times should be specified in UTC time like this: 2020-05-18T00:00:00Z
  6. Run the script. npm start.
  7. An {Canvas user id}-pageviews.csv file should be generated for each Canvas user id.

Note

Please note that this project downloads remote-ip, which is the origin IP address of the request. IP addresses are considered personal information and should be treated with care. Sharing IP addresses of students without formal approval from an Associate Dean is not permitted. Please contact the LTHub if you have any questions or concerns.

Authors

License

This project is licensed under the GNU General Public License v3.0.

About

Download Canvas user(s) full page view logs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •