Hi,
We are unable to track Clicks and Conversions for our searches under custom analyticsTags
. Though I could see my clicks and conversions as total in analytics view. But when we select the Filter in Analytics page, we see 0 clicks.
Requirement :
We have two Algolia search boxes on my page. Let’s say one for content search and the other for career search. So in the Analytics view, we wanted to see different slices for clicks and conversions for two boxes. So we decided to use different analyticsTags
to differentiate between two searches.
Issue :
Clicks and Conversions are 0
for custom analyticsTags
filter in Analytics view. But they appear as a whole without Filters.
Below is our configuration:
-
using instant-search for search
instantsearch.widgets.configure({ clickAnalytics: true, analyticsTags: [ "search_type:content-search", ], instantsearch.widgets.configure({ clickAnalytics: true, analyticsTags: [ "search_type:career-search", ],
-
For Click firing
instantsearch.connectors.connectInfiniteHits( (renderArgs, isFirstRender) => { const { hits, sendEvent } = renderArgs; container.addEventListener('click', (event) => { if (event.target.parentElement.matches('.hit-title')) { const hit = getClickedHit(event.target.parentElement); // Send Click event to Algolia Insights endpoint for Analytics sendEvent('click', hit, 'Search on Item'); } }, false); container.querySelector('.search-results').innerHTML = `{hits.getHTML()}`
Open Question:
- Our ‘hit’ object for sendEvent has queryID and objectID, but it won’t have analyticsTags.
- How does the mapping happen when a click is received at the insight-server.
- Is there any additional configuration missing, I did not find details in the documentation on this.
Any guidance on how we proceed here.