1.21.5 • Published 7 months ago

@elastic/search-ui-analytics-plugin v1.21.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

Search UI Analytics Plugin

Use the Analytics Plugin to send analytics events to the Behavioral Analytics Product. Follow the instructions to set up the plugin.

Installation

yarn add @elastic/search-ui-analytics-plugin
## OR
npm install @elastic/search-ui-analytics-plugin

Basic Usage

Add the Analytics Plugin to your Search UI configuration like so:

import AnalyticsPlugin from "@elastic/search-ui-analytics-plugin";

// search ui configuration
const config = {
  apiConnector: connector,
  searchQuery: { ... },
  plugins: [ AnalyticsPlugin() ]
}

By default, the Analytics Plugin will use the Behavioral Analytics client provided when using script tag integration.

Passing in a custom analytics client

If you integrated Behavioral Analytics using the @elastic/behavioral-analytics-javascript-tracker NPM package, you can pass in a custom analytics client to the Analytics Plugin.

import AnalyticsPlugin from "@elastic/search-ui-analytics-plugin";
import { createTracker, getTracker } from "@elastic/behavioral-analytics-javascript-tracker";

createTracker({
  // the DSN can be found in the Behavioral Analytics Collections view page
    dsn: "https://my-analytics-dsn.elastic.co"
})

// search ui configuration
const config = {
  apiConnector: connector,
  searchQuery: { ... },
  plugins: [
    AnalyticsPlugin({
      client: getTracker()
    })
  ]
}

Options

The Analytics Plugin accepts the following options:

OptionTypeDescriptionDefault
clientAnalyticsTrackerThe Behavioral Analytics client to use. Read more on Behavioral Analytics Tracker repowindow.elasticAnalytics
1.21.5

7 months ago

1.21.4

8 months ago

1.21.3

8 months ago

1.21.2

8 months ago

1.21.1

9 months ago

1.21.0

9 months ago

1.19.1

2 years ago

1.20.1

2 years ago

1.20.2

2 years ago

1.20.0

2 years ago

1.19.0

2 years ago

1.18.3

2 years ago

1.18.2

2 years ago

1.8.2

2 years ago

1.18.1

2 years ago

1.18.0

2 years ago