Commit cddc491
committed
Add plugin for Matomo to track site search keywords
Use the plugins API for autocomplete, hook into the state change,
retrieve the query term from the use, and send the query term together
with the search results from the global context to Matomo.
* autocomplete plugins: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/
* autocomplete state: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/
* autocomplete access data with context: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/context/
https://developer.matomo.org/guides/tracking-javascript-guide#internal-search-tracking
Relates to #161 parent 255b3d8 commit cddc491
2 files changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| 130 | + | |
| 131 | + | |
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
| |||
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
| 289 | + | |
285 | 290 | | |
286 | 291 | | |
287 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments