# Coveo Analytics Component (CoveoAnalytics)

## Index

### Methods

- clearLocalData
- debugInfo
- disable
- enable
- getBindings
- logClickEvent
- logCustomEvent
- logSearchAsYouType
- logSearchEvent
- pushToGtmDataLayer
- setOriginContext
- get

### Properties

- bind
- client
- componentOptionsModel
- componentStateModel
- disabled
- logger
- queryController
- queryStateModel
- root
- searchInterface
- ID

### Accessors

- usageAnalytics

### Component Options

- anonymous
- autoPushToGtmDataLayer
- endpoint
- gtmDataLayerName
- organization
- searchHub
- splitTestRunName
- splitTestRunVersion
- token
- user
- userDisplayName

### Constructors

- constructor

## Methods

### clearLocalData

- clearLocalData(): void

- - Defined in ui/Analytics/Analytics.ts :411

  #### Returns void

### debugInfo

- debugInfo(): any

- Inherited from BaseComponent.debugInfo

  - Defined in ui/Base/BaseComponent.ts :41

  #### Returns any

### disable

- disable(): void

- Overwrites BaseComponent.disable

  - Defined in ui/Analytics/Analytics.ts :422

  #### Returns void

### enable

- enable(): void

- Overwrites BaseComponent.enable

  - Defined in ui/Analytics/Analytics.ts :396

  #### Returns void

### getBindings

- getBindings(): IComponentBindings

- Inherited from Component.getBindings

  - Defined in ui/Base/Component.ts :328

  #### Returns IComponentBindings

### logClickEvent

- logClickEvent(actionCause: IAnalyticsActionCause, meta: IAnalyticsDocumentViewMeta, result: IQueryResult, element?: HTMLElement): void

- - Defined in ui/Analytics/Analytics.ts :370

  #### Parameters

  - ##### actionCause: IAnalyticsActionCause

  - ##### meta: IAnalyticsDocumentViewMeta

  - ##### result: IQueryResult

  - ##### Default value element: HTMLElement = this.element

  #### Returns void

### logCustomEvent

- logCustomEvent<T>(actionCause: IAnalyticsActionCause, meta: T, element?: HTMLElement, result?: IQueryResult): void

- - Defined in ui/Analytics/Analytics.ts :342

  #### Type parameters

  - #### T

  #### Parameters

  - ##### actionCause: IAnalyticsActionCause

  - ##### meta: T

  - ##### Default value element: HTMLElement = this.element

  - ##### Optional result: IQueryResult

  #### Returns void

### logSearchAsYouType

- logSearchAsYouType<T>(actionCause: IAnalyticsActionCause, meta: T): void

- - Defined in ui/Analytics/Analytics.ts :315

  #### Type parameters

  - #### T

  #### Parameters

  - ##### actionCause: IAnalyticsActionCause

  - ##### meta: T

  #### Returns void

### logSearchEvent

- logSearchEvent<T>(actionCause: IAnalyticsActionCause, meta: T): void

- - Defined in ui/Analytics/Analytics.ts :286

  #### Type parameters

  - #### T

  #### Parameters

  - ##### actionCause: IAnalyticsActionCause

  - ##### meta: T

  #### Returns void

### pushToGtmDataLayer

- pushToGtmDataLayer(data: IAnalyticsEventArgs): void

- - Defined in ui/Analytics/Analytics.ts :448

  #### Parameters

  - ##### data: IAnalyticsEventArgs

  #### Returns void

### setOriginContext

- setOriginContext(originContext: string): void

- - Defined in ui/Analytics/Analytics.ts :389

  #### Parameters

  - ##### originContext: string

  #### Returns void

### Static get

- get(element: HTMLElement, componentClass?: any, noThrow?: boolean): BaseComponent

- Inherited from Component.get

  - Defined in ui/Base/Component.ts :410

  #### Parameters

  - ##### element: HTMLElement

  - ##### Optional componentClass: any

  - ##### Optional noThrow: boolean

  #### Returns BaseComponent

## Properties

### bind

bind: ComponentEvents

Inherited from Component.bind

- Defined in ui/Base/Component.ts :270

### client

client: IAnalyticsClient

- Defined in ui/Analytics/Analytics.ts :206

### componentOptionsModel

componentOptionsModel: ComponentOptionsModel

Inherited from Component.componentOptionsModel

- Defined in ui/Base/Component.ts :294

### componentStateModel

componentStateModel: ComponentStateModel

Inherited from Component.componentStateModel

- Defined in ui/Base/Component.ts :282

### disabled

disabled: boolean

Inherited from BaseComponent.disabled

- Defined in ui/Base/BaseComponent.ts :23

### logger

logger: Logger

Inherited from BaseComponent.logger

- Defined in ui/Base/BaseComponent.ts :18

### queryController

queryController: QueryController

Inherited from Component.queryController

- Defined in ui/Base/Component.ts :286

### queryStateModel

queryStateModel: QueryStateModel

Inherited from Component.queryStateModel

- Defined in ui/Base/Component.ts :278

### root

root: HTMLElement

Inherited from Component.root

- Defined in ui/Base/Component.ts :274

### searchInterface

searchInterface: SearchInterface

Inherited from Component.searchInterface

- Defined in ui/Base/Component.ts :290

### Static ID

ID: string

Inherited from BaseComponent.ID

- Defined in ui/Base/BaseComponent.ts :28

## Accessors

### usageAnalytics

usageAnalytics:

Inherited from Component.usageAnalytics

- Defined in ui/Base/Component.ts :343

## Component Options

### anonymous

anonymous: boolean

- Defined in ui/Analytics/Analytics.ts :132

Markup configuration example(s) :

    data-anonymous='true'
    data-anonymous='false'

### autoPushToGtmDataLayer

autoPushToGtmDataLayer: boolean

- Defined in ui/Analytics/Analytics.ts :187

Markup configuration example(s) :

    data-auto-push-to-gtm-data-layer='true'
    data-auto-push-to-gtm-data-layer='false'

### endpoint

endpoint: string

- Defined in ui/Analytics/Analytics.ts :111

Markup configuration example(s) :

    data-endpoint='foo'

### gtmDataLayerName

gtmDataLayerName: string

- Defined in ui/Analytics/Analytics.ts :199

Markup configuration example(s) :

    data-gtm-data-layer-name='foo'

### organization

organization: string

- Defined in ui/Analytics/Analytics.ts :178

Markup configuration example(s) :

    data-organization='foo'

### searchHub

searchHub: string

- Defined in ui/Analytics/Analytics.ts :148

Markup configuration example(s) :

    data-search-hub='foo'

### splitTestRunName

splitTestRunName: string

- Defined in ui/Analytics/Analytics.ts :158

Markup configuration example(s) :

    data-split-test-run-name='foo'

### splitTestRunVersion

splitTestRunVersion: string

- Defined in ui/Analytics/Analytics.ts :168

Markup configuration example(s) :

    data-split-test-run-version='foo'

### token

token: string

- Defined in ui/Analytics/Analytics.ts :100

Markup configuration example(s) :

    data-token='foo'

### user

user: string

- Defined in ui/Analytics/Analytics.ts :86

Markup configuration example(s) :

    data-user='foo'

### userDisplayName

userDisplayName: string

- Defined in ui/Analytics/Analytics.ts :93

Markup configuration example(s) :

    data-user-display-name='foo'

## Constructors

### constructor

- new Analytics(element: HTMLElement, options?: IAnalyticsOptions, bindings?: IComponentBindings): Analytics

- Overwrites Component.constructor

  - Defined in ui/Analytics/Analytics.ts :208

  #### Parameters

  - ##### element: HTMLElement

  - ##### Default value options: IAnalyticsOptions = {}

  - ##### Optional bindings: IComponentBindings

  #### Returns Analytics