Skip to content

Commit

Permalink
remove client-side analytics
Browse files Browse the repository at this point in the history
maybe only temporarily, as it's not so straightforward to make it instance-agnostic:
- depending on the version of Piwik/Matomo, the variables might be named differently?
- where to take the config from where piwik.js/matomo.js should be downloaded?
- maybe this should be moved aside from the build pipeline, as not all instance might want it?

maybe it's for good?: most people in our audience probably block the request to piwiki.js anyway
  • Loading branch information
maxlath committed Jan 28, 2025
1 parent 557d822 commit 824430a
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 107 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ public/dist
node_modules
vendor
scripts/assets
app/assets/piwik.js
app/assets/js/languages_data.ts
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ module.exports = {
L: 'writable',
FilteredCollection: 'writable',
Handlebars: 'writable',
Piwik: 'writable',
// Browser globals
alert: 'readonly',
screen: 'readonly',
Expand Down
3 changes: 0 additions & 3 deletions app/init_app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import app from '#app/app'
import initDataWaiters from '#app/lib/data/waiters'
import initPiwik from '#app/lib/piwik'
import initQuerystringHelpers from '#app/lib/querystring_helpers'
import reloadOnceADay from '#app/lib/reload_once_a_day'
import Entities from '#entities/entities'
Expand Down Expand Up @@ -57,6 +56,4 @@ export default async function () {
app.execute('waiter:resolve', 'layout')
reloadOnceADay()
})

initPiwik()
}
5 changes: 0 additions & 5 deletions app/lib/metadata/update_node_type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import app from '#app/app'
import log_ from '#app/lib/loggers'
import applyTransformers from './apply_transformers.ts'
import { metaNodes, possibleFields } from './nodes.ts'
Expand All @@ -21,10 +20,6 @@ export default function (key: string, value: string, noCompletion?: boolean) {
return
}

if (key === 'title') {
app.execute('track:page:view', value)
}

value = applyTransformers(key, value, noCompletion)
for (const el of metaNodes[key]) {
updateNodeContent(value, el)
Expand Down
87 changes: 0 additions & 87 deletions app/lib/piwik.ts

This file was deleted.

3 changes: 0 additions & 3 deletions app/modules/user/models/main_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export default UserCommons.extend({
this.on('shelves:change', this.updateShelvesCounter.bind(this))
this.on('listings:change', this.updateListingsCounter.bind(this))

// user._id should only change once from undefined to defined
this.once('change:_id', (model, id) => app.execute('track:user:id', id))

this.set('itemsCategory', 'personal')

// If the user is logged in, this will wait for their document to arrive
Expand Down
7 changes: 0 additions & 7 deletions scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ cp -r app/assets/* ./public
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile
git config blame.ignoreRevsFile .git-blame-ignore-revs

# Initialize global variables to prevent triggering
# an 'assignment to undeclared variable JSON_PIWIK' errors
# as webpack imports this script as an ES module, thus activating strict mode
# See https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Erreurs/Undeclared_var
echo 'let JSON_PIWIK, AnalyticsTracker, piwik_log;' > ./vendor/piwik.js
curl -sk https://piwik.allmende.io/piwik.js >> ./vendor/piwik.js

echo "// A polyfill for visualViewport is required until we stop supporting Firefox < v91
// https://developer.mozilla.org/en-US/docs/Web/API/Window/visualViewport#browser_compatibility
// Source: https://github.com/WICG/visual-viewport/blob/gh-pages/polyfill/visualViewport.js
Expand Down

0 comments on commit 824430a

Please sign in to comment.