[Search] SearchBar Analytics tracking (#8656)

* test capture search bar events

Signed-off-by: Emma Indal <emmai@spotify.com>

* capture search bar events

Signed-off-by: Emma Indal <emmai@spotify.com>

* only run onChange method if provided, otherwise set term

Signed-off-by: Emma Indal <emmai@spotify.com>

* changeset

Signed-off-by: Emma Indal <emmai@spotify.com>

* unconditionally call analytics API

Signed-off-by: Emma Indal <emmai@spotify.com>

* update changeset to be less specific to GA

Signed-off-by: Emma Indal <emmai@spotify.com>

* move analytics tracking to SearchBarBase

Signed-off-by: Emma Indal <emmai@spotify.com>

* add search to key events

Signed-off-by: Emma Indal <emmai@spotify.com>

* capture types as analytics context attribute, only for SearchBar

Signed-off-by: Emma Indal <emmai@spotify.com>

* move AnalyticsContext to within SearchContextProvider

Signed-off-by: Emma Indal <emmai@spotify.com>

* refactor search tracking out to its own component

Signed-off-by: Emma Indal <emmai@spotify.com>

* captures not only google analytics

Signed-off-by: Emma Indal <emmai@spotify.com>
This commit is contained in:
Emma Indal
2021-12-29 14:10:01 +01:00
committed by GitHub
parent e35aff0d16
commit af4980fb5d
7 changed files with 223 additions and 24 deletions
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search': patch
---
Captures the search term entered in the SearchBarBase as a `search` event.