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

Send media downloads to analytics #6063

Merged
merged 2 commits into from Aug 16, 2019

Conversation

@davidfischer
Copy link
Contributor

commented Aug 9, 2019

While data will be sampled, this will give us an idea of how frequently media (zips, PDFs, ePubs) are downloaded.

@davidfischer davidfischer requested a review from readthedocs/core Aug 9, 2019

@ericholscher
Copy link
Member

left a comment

💯 Great start to at least getting the data.

event_action=f'Download {type_}',
event_label=str(version),
ua=request.META.get('HTTP_USER_AGENT'),
uip=get_client_ip(request),

This comment has been minimized.

Copy link
@ericholscher

ericholscher Aug 9, 2019

Member

Do we want/need to send this?

This comment has been minimized.

Copy link
@davidfischer

davidfischer Aug 9, 2019

Author Contributor

If we don't care about it, we could definitely drop it. It is anonymized but it also isn't really useful. I'd be fine dropping it.

This comment has been minimized.

Copy link
@ericholscher

ericholscher Aug 9, 2019

Member

Up to you. I'm 👍 on dropping it if we don't need it though.

This comment has been minimized.

Copy link
@davidfischer

davidfischer Aug 10, 2019

Author Contributor

I'll update. Let's drop it. Seems cleaner that way especially since we don't need it. I'll just verify that GA doesn't silently drop requests without them.

This comment has been minimized.

Copy link
@davidfischer

davidfischer Aug 12, 2019

Author Contributor

In my testing, without sending something for the user agent and IP address, the event doesn't show up in the realtime reporting. I'll give it a day to see if it does show up in the aggregated reporting but we may need to send some value for those settings. That could be the server's IP address.

This comment has been minimized.

Copy link
@ericholscher

ericholscher Aug 12, 2019

Member

Alright, let's just ship it and let GA anonymize it, we're already doing it elsewhere.

This comment has been minimized.

Copy link
@davidfischer

davidfischer Aug 13, 2019

Author Contributor

After looking at GA's regular reporting, only the events with an IP and UA were counted.

@ericholscher ericholscher merged commit 9f92834 into master Aug 16, 2019

3 checks passed

continuous-documentation/read-the-docs Read the Docs build succeeded!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
pyup.io/safety-ci No dependencies with known security vulnerabilities.
Details

@ericholscher ericholscher deleted the davidfischer/media-download-analytics branch Aug 16, 2019

@ericholscher

This comment has been minimized.

Copy link
Member

commented Aug 16, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.