Skip to content

Commit

Permalink
Added analytics to track toggle all off clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
dhochbaum-dcp committed Mar 12, 2024
1 parent e4da6a8 commit 6007b44
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export default class ApplicationController extends Controller.extend(

@service mainMap;

@service metrics;

// this action extracts query-param-friendly state of layer groups
// for various paramable layers
@action
Expand All @@ -112,6 +114,18 @@ export default class ApplicationController extends Controller.extend(
.filter(({ visible }) => visible)
.forEach((model) => this.toggleLayerVisibilityToFalse(model));
this.handleLayerGroupChange();

gtag('event', 'search', {
event_category: 'Toggle Layer',
event_action: 'Toggle All Layers Off',
});

// GA
this.metrics.trackEvent('MatomoTagManager', {
category: 'Toggle Layer',
action: 'Toggle All Layers Off',
name: 'Toggle All Layers Off',
});
}

@action
Expand Down

0 comments on commit 6007b44

Please sign in to comment.