Add support for sending virtual pageviews on search events

Signed-off-by: Nikita Karpukhin <nikita.karpukhin@scout24.com>
This commit is contained in:
Nikita Karpukhin
2022-11-28 16:32:51 +01:00
parent 4e12e8a023
commit 9516b0c355
6 changed files with 216 additions and 1 deletions
+26
View File
@@ -53,6 +53,32 @@ export interface Config {
*/
identity?: 'disabled' | 'optional' | 'required';
/**
* Controls whether to send virtual pageviews on `search` events.
* Can be used to enable Site Search in GA.
*/
virtualSearchPageView?: {
/**
* - `disabled`: (Default) no virtual pageviews are sent
* - `only`: Sends virtual pageview _instead_ of the `search` event
* - `both`: Sends both the `search` event _and_ the virtual pageview
* @visibility frontend
*/
mode?: 'disabled' | 'only' | 'both';
/**
* Specifies on which path the main Search page is mounted.
* Defaults to `/search`.
* @visibility frontend
*/
mountPath?: string;
/**
* Specifies which query param is used in the virtual pageview URL.
* Defaults to `query`.
* @visibility frontend
*/
queryParam?: string;
};
/**
* Whether or not to log analytics debug statements to the console.
* Defaults to false.