You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently added Google Tag Manager to the Stacks Explorer in order to track custom events on the Explorer (a list of those events can be found here.
Importantly, we added tracking to the search bar and now track search_click when a user clicks the search bar to initiate a search as well as search_result_click when a user clicks a search result.
After reviewing a week of production data, it's clear that search_result_click is firing much more often than it should—twice as often as search_click.
Looking into the data, it looks like many elements on the Explorer share the same trackable click elements, so in the eyes of Google Tag Manager, clicks on actual search results look the same as clicks on other dynamic elements where the Explorer serves the user data (for example, it looks the same as clicks on the listed call-able functions in the sandbox, addresses listed in the transactions page, blocks on the blocks page, the list goes on).
In order to fix this issue, we need to add an id to search results in the same way that the search bar itself has a bit of code that says id="search-bar". This id should be search-bar-result and should be attached to any clickable element in a given search result, with the exception that this id should not be attached to the "clear result" link which deletes the search query.
The text was updated successfully, but these errors were encountered:
Hi @max-crawford! Id needs to be unique so if we have multiple search results we can't attach the same id to all of them, would a solution like id="search-bar-result-i", where i is 1 : n work?
We recently added Google Tag Manager to the Stacks Explorer in order to track custom events on the Explorer (a list of those events can be found here.
Importantly, we added tracking to the search bar and now track
search_click
when a user clicks the search bar to initiate a search as well assearch_result_click
when a user clicks a search result.After reviewing a week of production data, it's clear that
search_result_click
is firing much more often than it should—twice as often assearch_click
.Looking into the data, it looks like many elements on the Explorer share the same trackable click elements, so in the eyes of Google Tag Manager, clicks on actual search results look the same as clicks on other dynamic elements where the Explorer serves the user data (for example, it looks the same as clicks on the listed call-able functions in the sandbox, addresses listed in the transactions page, blocks on the blocks page, the list goes on).
In order to fix this issue, we need to add an
id
to search results in the same way that the search bar itself has a bit of code that saysid="search-bar"
. Thisid
should besearch-bar-result
and should be attached to any clickable element in a given search result, with the exception that this id should not be attached to the "clear result" link which deletes the search query.The text was updated successfully, but these errors were encountered: