-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Single analytics file for all builders #3896
Merged
ericholscher
merged 1 commit into
readthedocs:master
from
davidfischer:analytics-dynamic-include
Apr 5, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Google Analytics is a contentious issue inside Read the Docs and in our community. | ||
// Some users are very sensitive and privacy conscious to usage of GA. | ||
// Other users want their own GA tracker on their docs to see the usage their docs get. | ||
// The developers at Read the Docs understand that different users have different priorities | ||
// and we try to respect the different viewpoints as much as possible while also accomplishing | ||
// our own goals. | ||
|
||
// Read the Docs largely funds our operations and development through advertising and | ||
// advertisers ask us questions that are easily answered with an analytics solution like | ||
// "how many users do you have in Switzerland browsing Python docs?". We need to be able | ||
// to easily get this data. We also use data from GA for some development decisions such | ||
// as what browsers to support (or not) or how much usage a particular page/feature gets. | ||
|
||
// We have taken steps with GA to address some of the privacy issues. | ||
// Read the Docs instructs Google to anonymize IPs sent to them before they are stored (see below). | ||
|
||
// We are always exploring our options with respect to analytics and if you would like | ||
// to discuss further, feel free to open an issue on github. | ||
|
||
|
||
// RTD Analytics Code | ||
|
||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | ||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | ||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | ||
|
||
if (typeof READTHEDOCS_DATA !== 'undefined') { | ||
if (READTHEDOCS_DATA.global_analytics_code) { | ||
ga('create', READTHEDOCS_DATA.global_analytics_code, 'auto', 'rtfd'); | ||
ga('rtfd.set', 'dimension1', READTHEDOCS_DATA.project); | ||
ga('rtfd.set', 'dimension2', READTHEDOCS_DATA.version); | ||
ga('rtfd.set', 'dimension3', READTHEDOCS_DATA.language); | ||
ga('rtfd.set', 'dimension4', READTHEDOCS_DATA.theme); | ||
ga('rtfd.set', 'dimension5', READTHEDOCS_DATA.programming_language); | ||
ga('rtfd.set', 'dimension6', READTHEDOCS_DATA.builder); | ||
ga('rtfd.set', 'anonymizeIp', true); | ||
ga('rtfd.send', 'pageview'); | ||
} | ||
|
||
// User Analytics Code | ||
if (READTHEDOCS_DATA.user_analytics_code) { | ||
ga('create', READTHEDOCS_DATA.user_analytics_code, 'auto', 'user'); | ||
ga('user.set', 'anonymizeIp', true); | ||
ga('user.send', 'pageview'); | ||
} | ||
// End User Analytics Code | ||
} | ||
|
||
// end RTD Analytics Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
readthedocs/doc_builder/templates/doc_builder/include.js.tmpl
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👍