-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: add Google Analytics tracking. #6601
Conversation
@@ -107,6 +120,10 @@ function render(lexed, filename, template, cb) { | |||
}); | |||
} | |||
|
|||
function gaScriptContent() { | |||
return fs.readFileSync(gaScriptPath).toString(); |
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.
Allowed my self to use Sync
here as this is a build script, where doing async doesn't do too much for performance, other than increasing code complexity.
The build is release by default... I don't really want this in local docs tbh |
@Fishrock123 yeah, although this provides a way to opt-out of tracking, it's not ideal as In a perfect world the tracking script would only be included when actually cutting new releases. I don't have access to the release build jobs so I haven't been able to see what exactly is run when building new versions - is there anything unique about those builds we could pick up automatically? |
A flag could be added to |
I'd like thoughts from @nodejs/build |
Here's my thoughts on where this needs to go:
|
Thanks @rvagg, a lot of good tips I wasn't aware of there. I'll look into using a make variable instead. |
8044926
to
dc3e6ca
Compare
@rvagg PTAL now. Couldn't see any reason |
27e1a70
to
005cf5b
Compare
@@ -45,5 +45,6 @@ | |||
<script src="assets/sh_main.js"></script> | |||
<script src="assets/sh_javascript.min.js"></script> | |||
<script>highlight(undefined, undefined, 'pre');</script> | |||
__TRACKING__ |
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.
can we perhaps comment this? <!-- __TRACKING__ -->
-- that way we don't have to process any files if tracking is disabled.
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.
@jbergstroem it gets replaced w/empty string when tracking is disabled, which is default, so it shouldn't be needed to enclose in comments?
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.
yeah was just suggesting we could avoid it altogether (replacing with empty) by making it a html comment.
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.
Following up on this. Why waste cpu cycles if we don't have to?
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.
@jbergstroem sorry this slipped. I just pushed an update using a comment as you've suggested, PTAL.
Personally, I don't like the idea of including GA to the docs.
Piwik looks as a possible solution to me (judging only by description, I have not tested it). I don't want to block GA though if others agree that we need it, so that's a -0. /cc @nodejs/ctc |
I second what @ChALkeR said. The motivation in nodejs/nodejs.org#709 is knowing what parts of the documentation are visited more. It should be fairly straightforward to pull that information from the server logs, right? |
Agreed with @ChALkeR. I use Piwik and it gets the job done. In case it helps, here is a screenshot from my own blog's stats: https://www.dropbox.com/s/cj7vnjbzn70gp8n/Screenshot%202016-05-19%2017.24.32.png?dl=0 |
@mikeal as you initially tried to add GA tracking, what's your thoughts on using Piwik instead? |
I have some points.
So I am rather for deferring this to some later point and rather for GA (and additional others.) |
We are using Google Analytics in several other places already and it would not be ideal to use something else for this as it makes things far more difficult. For instance, if we want to know the number of unique users across the website including the API docs this would make that impossible. |
I don't think so, it will still store and use unanonymized data.
Could you elaborate? I was speaking only about anonymized data only. I'm not sure how does sharing the data with a third party not open similar issues then.
That might be significantly more complex.
I expect docs to be significantly more visited than any other places, so for anyone who views third-party unanonymized tracking as being harmful/unacceptable, including GA to the docs will make the situation considerably worse. /cc @nodejs/inclusivity, btw.
Perhaps we should to add self-hosted tracking everywhere where GA is currently used, then? It should not harm to use them together for a time, I suppose. |
356224b
to
34bf996
Compare
Rebased on top of master. As it doesn't seem to be consensus about using GA for docs tracking, should this be scheduled for the next CTC-meeting? /cc @nodejs/ctc |
No, CloudFlare serves the majority of our doc requests. Although, we do apparently have a path to getting full logs from CF (it's an Enterprise feature but we've discussed it with them already). Log processing is pretty far from optimal for what's being asked for here. Those who are concerned about being tracked are probably already blocking GA, either explicitly or with blocking tools (I have two of them installed in my current browser!). I'm not a huge fan of giving more data to Google about the entire world but weighing that against the useful information that the docs WG could glean from this puts me well into the +1 for this. Also, in case anyone's reading this and misinterprets: this is only enabling it for nodejs.org, not self-hosted or even in the tarball we ship. Someone in @nodejs/build, maybe me, will need to confirm that the |
Have you considered self-hosted tracking? Why is GA viewed as the only option to achieve that here? |
34bf996
to
0851ad1
Compare
Landed in 01b90ee |
FYI / later reference: while merging this, I read through the COLLABORATOR_GUIDE.md and wanted to try the trick mentioned there, getting the PR status "merged" rather than "closed" by running That didn't work as expected. (1) Status was shown as "Closed" and (2) the UI shows this PR has 0 file changes. Not getting the "merged" status doesn't matter, but 0 file changes are really misleading tho! |
Adds Google Analytics tracking script to all doc pages when `DOCS_ANALYTICS` is set when running `make`: ```bash $ DOCS_ANALYTICS=<GOOGLE ANALYTICS ID> make ``` By default (when `DOCS_ANALYTICS` is not set), no tracking scripts are included. It respects "Do Not Track" settings end users might have in their browser. Also changes make target `doc-upload` from depending on the `$(TARBALL)` target, to only depend on `doc` directly. PR-URL: #6601 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@phillipj did you push to If you force push to your branch before updating |
Aaah thanks for elaborating, that explained what I did wrong. I pushed to
master node/master first.
…On Sat, 28 Jan 2017 at 14:12, Gibson Fahnestock ***@***.***> wrote:
@phillipj <https://github.com/phillipj> did you push to nodejs/master
before you pushed to phillipj/ga-docs-tracking? The PR only counts as
merged if the head of your fork branch has the same SHA as the commit you
push to master, so if you change the commit message then push to master,
Github will say there are 0 changes, because only the commit messages (and
hashes) have changed.
If you force push to your branch before updating node/master, that should
work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6601 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABLLExYSygPcJPMrlUcR2tMY8Jzq6GfOks5rWz6ugaJpZM4IYPrE>
.
|
Adds Google Analytics tracking script to all doc pages when `DOCS_ANALYTICS` is set when running `make`: ```bash $ DOCS_ANALYTICS=<GOOGLE ANALYTICS ID> make ``` By default (when `DOCS_ANALYTICS` is not set), no tracking scripts are included. It respects "Do Not Track" settings end users might have in their browser. Also changes make target `doc-upload` from depending on the `$(TARBALL)` target, to only depend on `doc` directly. PR-URL: nodejs#6601 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Adds Google Analytics tracking script to all doc pages when `DOCS_ANALYTICS` is set when running `make`: ```bash $ DOCS_ANALYTICS=<GOOGLE ANALYTICS ID> make ``` By default (when `DOCS_ANALYTICS` is not set), no tracking scripts are included. It respects "Do Not Track" settings end users might have in their browser. Also changes make target `doc-upload` from depending on the `$(TARBALL)` target, to only depend on `doc` directly. PR-URL: nodejs#6601 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Adds Google Analytics tracking script to all doc pages when `DOCS_ANALYTICS` is set when running `make`: ```bash $ DOCS_ANALYTICS=<GOOGLE ANALYTICS ID> make ``` By default (when `DOCS_ANALYTICS` is not set), no tracking scripts are included. It respects "Do Not Track" settings end users might have in their browser. Also changes make target `doc-upload` from depending on the `$(TARBALL)` target, to only depend on `doc` directly. PR-URL: #6601 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Adds Google Analytics tracking script to all doc pages when `DOCS_ANALYTICS` is set when running `make`: ```bash $ DOCS_ANALYTICS=<GOOGLE ANALYTICS ID> make ``` By default (when `DOCS_ANALYTICS` is not set), no tracking scripts are included. It respects "Do Not Track" settings end users might have in their browser. Also changes make target `doc-upload` from depending on the `$(TARBALL)` target, to only depend on `doc` directly. PR-URL: #6601 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Adds Google Analytics tracking script to all doc pages when `DOCS_ANALYTICS` is set when running `make`: ```bash $ DOCS_ANALYTICS=<GOOGLE ANALYTICS ID> make ``` By default (when `DOCS_ANALYTICS` is not set), no tracking scripts are included. It respects "Do Not Track" settings end users might have in their browser. Also changes make target `doc-upload` from depending on the `$(TARBALL)` target, to only depend on `doc` directly. PR-URL: #6601 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Adds Google Analytics tracking script to all doc pages when `DOCS_ANALYTICS` is set when running `make`: ```bash $ DOCS_ANALYTICS=<GOOGLE ANALYTICS ID> make ``` By default (when `DOCS_ANALYTICS` is not set), no tracking scripts are included. It respects "Do Not Track" settings end users might have in their browser. Also changes make target `doc-upload` from depending on the `$(TARBALL)` target, to only depend on `doc` directly. PR-URL: #6601 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@phillipj @mikeal @chrisdickinson Several months have passed with this landed. What information were we able to collect and how exactly is can we use it to improve things? |
@ChALkeR thanks for following up 👍 Although this was merged a long time ago, it was activated a couple of weeks ago: nodejs/nodejs.org#1268 (comment). By checking the docs deployed to production, v8.1.3 docs looks like the first set of docs that has GA tracking enabled. In other words I think it's a little early to answer your question about what the stats collected has provided of actual value yet. Maybe @feross has some future plans? |
Any updates? |
The Google Analytics tracking wasn't wholly uncontroversial and hasn't been used in practice. Remove it. Refs: nodejs#6601 Fixes: nodejs#22652
The Google Analytics tracking wasn't wholly uncontroversial and hasn't been used in practice. Remove it. PR-URL: #23083 Fixes: #22652 Refs: #6601 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The Google Analytics tracking wasn't wholly uncontroversial and hasn't been used in practice. Remove it. PR-URL: #23083 Fixes: #22652 Refs: #6601 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The Google Analytics tracking wasn't wholly uncontroversial and hasn't been used in practice. Remove it. PR-URL: #23083 Fixes: #22652 Refs: #6601 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
Affected core subsystem(s)
tools, doc
Description of change
Original changes has been discarded after discussions below.
This adds Google Analytics tracking to the bottom of all doc pages if
we're building formake is run withRelease
DOCS_ANALYTICS
variable present.Any thoughts about this so far? Would you consider using build type like this sufficient to avoid tracking locally or other scenarios when tracking isn't wanted?
Refs nodejs/nodejs.org#709
/cc @nodejs/documentation