WillD1
Community Member

Page views api endpoint returns empty array for all users

I am trying to retrieve page view information from the canvas API. 

For Example: {{domain}}/api/v1/users/1/page_views

This request returns a 200 status but the response is an empty array `[]` 

Is there some sort of setting I must activate in order for canvas to start collecting page views? Or perhaps a plugin of some kind that needs to be installed? 

Thanks.

Labels (1)
0 Kudos
5 Replies
James
Community Champion

@WillD1 

Are you sure that user 1 has any page views? Try viewing the page views for your account.

The token you're using should be good or you would be getting an authorized error, not an empty response. The same thing would happen if there was no user 1. However, if user 1 has never logged in and viewed pages, then it would be empty. I verified this behavior with a user that has never logged in on our site.

0 Kudos
WillKP
Community Member

User #1 is an account one that I have access to. I know that this user has signed on and viewed several different views in canvas, courses, pages, assignments, etc. Additionally my script loops through every user ID in my subaccount ID and checks for page_views. They all result in an empty array as response. 

0 Kudos
James
Community Champion

@WillKP 

Does this mean that you are running your own instance of Canvas as opposed to a hosted version? I don't have any experience there, so someone else will have to help.

WillD1
Community Member

Yes the instance I am working with is self-hosted on AWS. 

0 Kudos
WillKP
Community Member

Is there anyone that can help? I am still waiting on a solution to why it would return empty array. 

0 Kudos