-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Analytics: don't record page views for PR previews #11065
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great that you noticed this! 💯
if version.is_external or not unresolved.filename: | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why version.is_external
is required here? Won't be captured by the previous line if self.request.unresolved_domain.is_from_external_domain:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first check is to know if we are calling the API from an external domain foo--123.readthedocs.build
, this check is to know if we are recording a page view for an external version from a normal domain.
We should skip calling this endpoint from the client, probably something we can do from the addons, for our current js client, we would need to return a new field to know if the version is external.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should skip calling this endpoint from the client, probably something we can do from the addons
This makes sense. Feel free to open an issue in the addons repository and I can work on it.
The first check is to know if we are calling the API from an external domain
foo--123.readthedocs.build
, this check is to know if we are recording a page view for an external version from a normal domain.
Would you mind adding this knowledge as a small code comment on each check?
PR previews are ephemeral, they shouldn't be counted as page views.
Other changes are: