Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to get complete history for pages visits? #365

Open
alexeyqu opened this issue Aug 4, 2023 · 3 comments
Open

Any way to get complete history for pages visits? #365

alexeyqu opened this issue Aug 4, 2023 · 3 comments

Comments

@alexeyqu
Copy link

alexeyqu commented Aug 4, 2023

Hi, I am new here and curious if it is possible to query complete view counts for a page?

The getDomains.statistics.pages query needs a range param which can't be null and only allows to query data up to 6 months.

So, 2 questions (I could probably figure this out from code but want to confirm)

  1. are the views stored indefinitely in the DB? i.e. does Ackee delete 6 months+ old records?
  2. is there any way to query that historic data from the API? IMO the simplest idea would be to make the range param nullable which will allow to not have any created filters in the aggregations.

Happy to make a PR for the latter. Thanks!

@mab253
Copy link

mab253 commented Sep 21, 2023

I'm also very interested in this! I was surprised to see that the API is limited by the same range (LAST_6_MONTHS) that we see in the UI. I'm hoping to be able to see all-time page view counts and add this feature to the dashboard.

From cursory exploration in the MongoDB it looks like all the records are still there ... so being able to query them all in the API would be fantastic!

@mab253
Copy link

mab253 commented Oct 3, 2023

I did end up figuring this out! Re your questions @alexeyqu:

  1. The MongoDB does keep all of the events, views, etc.
  2. You do have to change the range filters in the code in multiple places, but I was able to add "Last 12 Months" as well as "Last 7 Years" (and I believe there would be no limit here)

Check it out here: UnlockNYC/Ackee@3a70457

@stfnhmplr
Copy link

@mab253 This works fine. It would be great if at least the "Last 12 Months" option gets merged. Could be helpful for a yearly review. Did you consider creating a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants