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
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.
- Install Node 10 or greater.
- Install Git.
- Create a
.env
file. - Generate Canvas API token and copy it to clipboard.
- Add the following:
CANVAS_API_TOKEN={YOUR API TOKEN}
andCANVAS_API_DOMAIN={YOUR API DOMAIN}
. An exampleCANVAS_API_DOMAIN
ishttps://{school}.instructure.com/api/v1
- Clone this repo.
git clone https://github.com/ubccapico/canvas-page-view
- Then cd into the repo.
cd canvas-page-view
- Run the installation script.
npm install
(If you seebabel-node: command not found
, you've missed this step.) - 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 */)
- The start and end times should be specified in UTC time like this:
2020-05-18T00:00:00Z
- Run the script.
npm start
. - An
{Canvas user id}-pageviews.csv
file should be generated for each Canvas user id.
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.
- justin0022 - Justin Lee <justin.lee@ubc.ca>
This project is licensed under the GNU General Public License v3.0.