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

feat: added pageviews analytics functions (#4336) #4339

Merged
merged 7 commits into from
Jan 23, 2025

Conversation

jpaten
Copy link
Contributor

@jpaten jpaten commented Jan 15, 2025

Ticket

Closes #4336.

Reviewers

@hunterckx.
@NoopDog

Changes

  • Added functions to get page views from GA as a single indexed dataframe
  • Added functions to get the change in page views from GA

Notes

@jpaten jpaten requested review from NoopDog and hunterckx January 15, 2025 04:56
@jpaten jpaten linked an issue Jan 15, 2025 that may be closed by this pull request
@github-actions github-actions bot added the canary Done by the Clever Canary team label Jan 15, 2025
@hunterckx
Copy link
Contributor

Seems like this was closed erroneously as a result of being accidentally referenced as the ticket for #4335

@hunterckx hunterckx reopened this Jan 20, 2025
@jpaten
Copy link
Contributor Author

jpaten commented Jan 22, 2025

Whoops! Thanks for reopening @hunterckx

@jpaten jpaten force-pushed the jonah/4336-add-page-views-to-analytics-package branch from f593732 to 6c12a65 Compare January 22, 2025 01:14
@jpaten jpaten marked this pull request as ready for review January 22, 2025 01:14
@jpaten jpaten force-pushed the jonah/4336-add-page-views-to-analytics-package branch from 0b5c3c3 to eff8ff7 Compare January 22, 2025 07:25
series_current_reindexed = series_current.reindex(combined_index).fillna(0)
# Adjust the values from the prior series to account for the different number of days in the month
series_previous_reindexed = (series_previous.reindex(combined_index) * current_length / previous_length)
change = ((series_previous_reindexed / series_current_reindexed) - 1).replace({np.inf: np.nan})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the division might be backward here if we want change from previous to current?

@hunterckx hunterckx merged commit 6d65fae into main Jan 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
canary Done by the Clever Canary team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add page views to analytics package
2 participants