Skip to content

Commit

Permalink
Search bar only analytics fix (#1555) (#1556)
Browse files Browse the repository at this point in the history
### Bugfixes
- Fix the analytics for the search bar only assets (#1555)
  • Loading branch information
cea2aj committed Sep 24, 2021
1 parent 7f600ea commit 2eae3b6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/answers-search-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import { SEARCH_BAR_COMPONENTS_REGISTRY } from './ui/components/search-bar-only-

const DEFAULTS = {
locale: LOCALE,
querySource: QUERY_SOURCE
querySource: QUERY_SOURCE,
analyticsEventsEnabled: true
};

/**
Expand Down Expand Up @@ -172,6 +173,7 @@ class AnswersSearchBar {
parsedConfig.experienceKey,
parsedConfig.experienceVersion,
parsedConfig.businessId,
parsedConfig.analyticsEventsEnabled,
parsedConfig.analyticsOptions,
parsedConfig.environment);

Expand Down Expand Up @@ -284,6 +286,14 @@ class AnswersSearchBar {
return this;
}

/**
* Opt in or out of analytic events
* @param {boolean} analyticsEventsEnabled
*/
setAnalyticsOptIn (analyticsEventsEnabled) {
this._analyticsReporterService.setAnalyticsOptIn(analyticsEventsEnabled);
}

/**
* Opt in or out of convertion tracking analytics
* @param {boolean} optIn
Expand Down

0 comments on commit 2eae3b6

Please sign in to comment.