Skip to content

Commit

Permalink
Remove client side tracking (OctoLinker#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbuck authored Jul 8, 2018
1 parent 5d4edbd commit b6795ab
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 133 deletions.
2 changes: 0 additions & 2 deletions packages/core/background/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as storage from '@octolinker/helper-settings';
import newTab from './newTab';
import insight from './insight';

storage.load().then(() => {
insight('UA-88792224-3', storage.get('clientId'), storage.get('doTrack'));
newTab();
});
71 changes: 0 additions & 71 deletions packages/core/background/insight.js

This file was deleted.

13 changes: 1 addition & 12 deletions packages/core/click-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,9 @@ async function onClick(event) {
return;
}

const track = action =>
chrome.runtime.sendMessage({
type: 'track',
payload: {
category: 'fetch',
action,
},
});

try {
const { url, res } = await fetch(urls, storage.get('doTrack'));
const { url, res } = await fetch(urls);

track('success');
showTooltip($tooltipTarget, RESOLVED);

const newWindow =
Expand All @@ -113,7 +103,6 @@ async function onClick(event) {
openUrl((res || {}).url || url, newWindow, newWindowActive);
removeTooltip($tooltipTarget);
} catch (err) {
track('error');
showTooltip($tooltipTarget, SORRY);

return console.error(err); // eslint-disable-line no-console
Expand Down
3 changes: 1 addition & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@octolinker/plugin-typescript": "1.0.0",
"@octolinker/plugin-vim": "1.0.0",
"github-injection": "^1.0.1",
"jquery": "^3.2.1",
"querystring": "^0.2.0"
"jquery": "^3.2.1"
}
}
7 changes: 1 addition & 6 deletions packages/core/utils/fetch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import $ from 'jquery';

export default async (urls, doTrack) => {
export default async urls => {
for (const { url, func, method = 'HEAD' } of urls) {
try {
if (func) {
Expand All @@ -10,18 +10,13 @@ export default async (urls, doTrack) => {
};
}

const headers = {
'Do-Not-Track': !doTrack ? '1' : undefined,
};

// Normally, you wouldn't use `await` inside of a loop.
// However, we explicity want to do this sequentially.
// See http://eslint.org/docs/rules/no-await-in-loop
// eslint-disable-next-line
const res = await $.ajax({
method,
url,
headers,
});

return { url, res };
Expand Down
20 changes: 0 additions & 20 deletions packages/helper-settings/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import browser from 'webextension-polyfill';
import uuid from 'uuid';

const store = {};

Expand All @@ -8,7 +7,6 @@ const defaults = {
newWindowActive: true,
showLinkIndicator: true,
showUpdateNotification: true,
doTrack: true,
};

export const get = key => store[key];
Expand Down Expand Up @@ -44,23 +42,5 @@ export const load = async () => {

Object.assign(store, defaults, data);

if (!store.clientId) {
store.clientId = uuid.v4();
set('clientId', store.clientId);
}

for (const [key, value] of Object.entries(store)) {
if (Object.keys(defaults).includes(key)) {
chrome.runtime.sendMessage({
type: 'track',
payload: {
category: 'options',
action: key,
label: value.toString(),
},
});
}
}

return store;
};
3 changes: 1 addition & 2 deletions packages/helper-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"linkstate": "^1.1.0",
"preact": "^8.2.5",
"primer-core": "^6.4.0",
"primer-forms": "^1.4.0",
"uuid": "^3.1.0"
"primer-forms": "^1.4.0"
}
}
7 changes: 0 additions & 7 deletions packages/helper-settings/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ class App extends Component {
checked={state.showUpdateNotification}
onClick={linkState(this, 'showUpdateNotification')}
/>
<Checkbox
name="doTrack"
label="Usage reports"
description="Send anonymous usage reports to Google Analytics."
checked={state.doTrack}
onClick={linkState(this, 'doTrack')}
/>
</div>
);
}
Expand Down
11 changes: 0 additions & 11 deletions privacy-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,10 @@ We use NewRelic for monitoring our service, analyzing performance and reporting
### Keen.io
We use Keen.io to track and analyse how users interact with our service. In the “What information do we collect?” section we list all data that we collect.You can read [Keen's privacy terms](https://keen.io/privacy-policy/).

### Google Analytics
We use Google Analytics with the extension "_anonymizeIp()", which means that IP addresses are processed in an abbreviated form so that the IP address cannot be connected back to a user. You can read [Google's privacy terms](http://www.google.com/intl/en/policies/privacy/).

## Opt-out of data collection

We respect the privacy settings of your browser by honoring your `Do Not Track` status. You can also opt-out in the browser exntesion settings.

## How long will the data be stored

Keen.io
Keen.io stores data for as long as it is necessary to provide service. In most cases, data associated with a Keen.io account will be kept until a customer requests deletion.

Google Analytics
In our Google Analytics account we retain user data up to 26 months.

## How we protect your information

We adopt appropriate data collection, storage and processing practices and security measures to protect against unauthorized access, alteration, disclosure or destruction of your personal information and data stored on our service.
Expand Down

0 comments on commit b6795ab

Please sign in to comment.