Skip to content

feat: matomo site search tracking - #1247

Open
nicolaskempf57 wants to merge 6 commits into
mainfrom
feat/matomo-site-search-tracking
Open

nicolaskempf57 wants to merge 6 commits into
mainfrom
feat/matomo-site-search-tracking

Conversation

@nicolaskempf57

Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +27 to +33
const { $matomo } = useNuxtApp()

function trackSearch(keyword: string, type: string, total: number) {
if (!import.meta.client) return
$matomo.trackSiteSearch(keyword, type, total)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use an event from GlobalSearch, I would prefer to have this in GlobalSearch.vue directly. I think it's to avoid having Matomo inside the datagouv-components but we could add an optional Matomo object inside the datagouv-components and do the tracking there? It would prevent the duplicate listeners in organisation and datasets and also I think @search event reads a little bit like the parent of this component should do something about the search?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants