Skip to content

Commit

Permalink
feat(telemetry): ✨ Adding companion version to segments (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
whizzzkid authored Feb 1, 2023
1 parent 42eed02 commit 65fe66c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion add-on/src/lib/ipfs-companion.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ export default async function init () {

function onTelemetryMessage (request, sender) {
if (request.trackView) {
return trackView(request.trackView)
const { version } = browser.runtime.getManifest()
return trackView(request.trackView, { version })
}
}

Expand Down
4 changes: 2 additions & 2 deletions add-on/src/lib/telemetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export function handleConsentFromState (state) {
}

const ignoredViewsRegex = []
export function trackView (view) {
export function trackView (view, segments) {
log('trackView called for view: ', view)
metricsProvider.trackView(view, ignoredViewsRegex)
metricsProvider.trackView(view, ignoredViewsRegex, segments)
}

export const startSession = (...args) => metricsProvider.startSession(...args)
Expand Down

0 comments on commit 65fe66c

Please sign in to comment.