Skip to content

Commit

Permalink
Matomo QA updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandravaphilips committed Mar 18, 2024
1 parent 7404774 commit 4e11ee3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions peachjam/js/components/FindDocuments/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -659,19 +659,18 @@ export default {
trackSearch (params) {
const keywords = [];
const facets = [];
const fields = this.facets.map(facet => facet.name).concat(['date__range', 'date__gte', 'date__lte']);
params.forEach((value, key) => {
if (key.startsWith('search')) {
const s = key === 'search' ? '' : (key.substring(8) + '=');
keywords.push(s + value.strip());
keywords.push(s + value.trim());
} else if (fields.includes(key)) {
facets.push(`${key}=${params.getAll(key).join(',')}`);
}
});
const facets = [];
const fields = this.facets.map(f => f.name).concat('date__range', 'date__gte', 'date__lte');
fields.forEach(facet => {
if (params.has(facet)) facets.push(`${facet}=` + params.getAll(facet).join(';'));
});
analytics.trackSiteSearch(keywords.join('; '), facets.join('; '), this.searchInfo.count);
},
Expand Down

0 comments on commit 4e11ee3

Please sign in to comment.