-
Notifications
You must be signed in to change notification settings - Fork 492
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: add self-hosted, doNotTrack-aware, analytics #930
Conversation
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
A good first pass at the copy for "what data is collected?" From the info at https://resources.count.ly/docs/security-faq#section-default-metrics-properties-collected |
Tests for the bundle logic are in place 📋 ✅ ✨ PASS src/bundles/analytics.test.js
✓ should normalise the doNotTrack state from the navigator.doNotTrack value (6ms)
✓ should enable analytics if doNotTrack is falsey
✓ should disable analytics if doNotTrack is true (1ms)
✓ should enable analytics if doNotTrack is true but user has explicitly enabled it
✓ should disable analytics if doNotTrack is falsey but user has explicitly disabled it (1ms)
✓ should enable selectAnalyticsAskToEnable if doNotTrack is true and user has not explicity enabled or disabled it
✓ should disable selectAnalyticsAskToEnable if doNotTrack is true and user has explicity disabled it (1ms)
✓ should disable selectAnalyticsAskToEnable if doNotTrack is true and user has explicity enabled it
✓ should disable selectAnalyticsAskToEnable if analytics are enabled
✓ should toggle analytics (14ms)
Test Suites: 1 passed, 1 total
Tests: 10 passed, 10 total
Snapshots: 0 total
Time: 1.53s |
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
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.
In general LGTM, but please check my suggestions!
const items = Array(9).fill(1) | ||
return ( | ||
<React.Fragment> | ||
<Checkbox className='dib bg-white pa3' onChange={doToggleAnalytics} checked={analyticsEnabled} label={ |
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.
<Checkbox className='dib bg-white pa3' onChange={doToggleAnalytics} checked={analyticsEnabled} label={ | |
<Checkbox className='dib pa3' onChange={doToggleAnalytics} checked={analyticsEnabled} label={ |
I prefer this without the white background to blend with the rest of the Settings, but I'll leave it up to you!
{t('AnalyticsToggle.label')} | ||
</span> | ||
} /> | ||
<div className='f6 charcoal lh-copy mw7'> |
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.
<div className='f6 charcoal lh-copy mw7'> | |
<div className='f6 ml3 charcoal lh-copy mw7'> |
Co-Authored-By: olizilla <oli@tableflip.io>
Co-Authored-By: olizilla <oli@tableflip.io>
News on this. We're setting up a countly instance at |
Waiting on DNS for countly.ipfs.io https://github.com/protocol/infra/pull/438 |
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
I'd like to roll this out today, so please eyeball the code! |
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
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.
LGTM, tiny suggestions below
src/bundles/index.js
Outdated
repoStats | ||
repoStats, | ||
createAnalyticsBundle({ | ||
countlyAppKey: window.ipfsDesktop ? '47fbb3db3426d2ae32b3b65fe40c564063d8b55d' : '8fa213e6049bff23b08e5f5fbac89e7c27397612', |
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.
nit: meaning can be lost/swapped during future refectoring, and it will be awfully hard to detect.
May be safer to move API keys to COUNTLY_APPKEY_DESKTOP
/ COUNTLY_APPKEY_WEBUI
const
s
public/locales/en/settings.json
Outdated
"AnalyticsToggle": { | ||
"label": "Help improve this app by sending anonymous usage data", | ||
"summary": "What data is collected?", | ||
"paragraph1": "IPFS hosts a <1>Countly</1> instance to record anonymous usage data for this app.", |
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.
Perhaps we should clarify we mean Shipyard||Community||Project, not the protocol itself.
"paragraph1": "IPFS hosts a <1>Countly</1> instance to record anonymous usage data for this app.", | |
"paragraph1": "IPFS Shipyard hosts a <1>Countly</1> instance to record anonymous usage data for this app.", |
|
||
function getDoNotTrack () { | ||
if (!root.navigator) return false | ||
const value = root.doNotTrack || root.navigator.doNotTrack || root.navigator.msDoNotTrack |
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.
❤️
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.
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
Add analytics via self-hosted countly install.
WIP on #774
see also: ipfs/ipfs-gui#72
TODO:
License: MIT
Signed-off-by: Oli Evans oli@tableflip.io