Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding custom ID to search bar results #1720

Closed
max-crawford opened this issue Jul 8, 2024 · 3 comments · Fixed by #1797
Closed

Adding custom ID to search bar results #1720

max-crawford opened this issue Jul 8, 2024 · 3 comments · Fixed by #1797
Assignees
Labels

Comments

@max-crawford
Copy link

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.

@He1DAr
Copy link
Collaborator

He1DAr commented Sep 10, 2024

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?

@max-crawford
Copy link
Author

Yes, that solution would work fine. Thanks Heidar!

@blockstack-devops
Copy link

🎉 This issue has been resolved in version 1.210.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants