Skip to content

Commit 1a73cc3

Browse files
committed
feat(MatomoPlugin): At least 3 characters for Search analytics
Only send search terms when they have a least three characters of length. Otherwise, search analytics is cluttered with strings of no further use. Refs #4
1 parent a546796 commit 1a73cc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/docsearch-react/src/MatomoPlugin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var matomoSiteSearch_debounced = debounce(_matomoSiteSearch, 500);
1919
export function createMatomoPlugin() {
2020
return {
2121
onStateChange({ state }) {
22-
if ( state.isOpen && state.query.length > 0 && query_cache !== state.query ) {
22+
if ( state.isOpen && state.query.length > 2 && query_cache !== state.query ) {
2323
matomoSiteSearch_debounced(state.query, state.context.nbHits);
2424
}
2525
},

0 commit comments

Comments
 (0)