Skip to content

Commit

Permalink
chore(tracking): also track URL on browser action clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
lutangar committed Dec 20, 2019
1 parent 131ee41 commit b93ff04
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/background/sagas/tracking/trackUI.saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
NoticesFoundAction,
createErrorAction,
getURLFromActionMeta,
InstallationDetailsAction
InstallationDetailsAction,
BrowserActionClickedAction
} from 'app/actions';

export const startTrackingSaga = (tracker: Tracker) =>
Expand Down Expand Up @@ -66,13 +67,14 @@ export const trackCloseSaga = (tracker: Tracker) =>
};

export const trackBrowserActionClickedSaga = (tracker: Tracker) =>
function*(): SagaIterator {
function*(action: BrowserActionClickedAction): SagaIterator {
try {
yield call(tracker.trackEvent, {
category: 'UI',
action: 'click',
name: 'BrowserAction',
value: 0
value: 0,
url: getURLFromActionMeta(action)
});
} catch (e) {
createErrorAction()(e);
Expand Down

0 comments on commit b93ff04

Please sign in to comment.