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

Passing Quicksearch entries into URL Hash filter #1673

Open
ksascomm opened this issue Sep 26, 2024 · 1 comment
Open

Passing Quicksearch entries into URL Hash filter #1673

ksascomm opened this issue Sep 26, 2024 · 1 comment

Comments

@ksascomm
Copy link

Is it possible the pass the keywords entered into the quicksearch into the url hash, so we can track in GA etc what terms users are entering?

We are filtering content with a search field and button filters, and passing the button filters to create a URL hash. However, I cannot figure if its even possible to do the same with the quicksearch filter. Would I have to create a submit button to the input that passes whatever query term is entered into a hash?

codepen: https://codepen.io/ksascomm/pen/OJKVPWy
debug: https://cdpn.io/pen/debug/OJKVPWy?authentication_hash=vWkRwpWQZOnM#filter=*

@thesublimeobject
Copy link
Collaborator

@ksascomm — your debug expired, but regardless, i'm pretty sure you can do this with just a listener through GA without having to attach it through a hash. it's been awhile since i've done this so i can't make the best recommendation on exactly how to do it, but i'm pretty sure it's possible.

if you did want to do it via hash—and without a submit button—i suppose you could set some kind of debounce listener on the keyup listener (sort of how it's configured now, but perhaps with different settings as needed) that attaches the hash. i would probably go the route of the first one though, assuming it's possible.

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

No branches or pull requests

2 participants