Solved

Select element dropdown tracking with OnChange?

  • 29 September 2022
  • 2 replies
  • 231 views

Userlevel 1
Badge +1

I’m interested in tracking SELECT dropdown choices. 

I know that SELECT elements are different than most other HTML elements.  My understanding is that we can’t easily listen for the “current” user choice because the SELECT > OPTION is handled by browser-specific code (outside of the webpage).  Possibly, we need to wait until the form is submitted.

 

MY QUESTION:  Is there a way to track SELECT dropdown choices in Heap BEFORE the user hits submit?  Or do we need to notify Heap of the event via JavaScript once the user hits SUBMIT?

 

Thanks in advance for the assistance.

 

 

 

icon

Best answer by Christy H 29 September 2022, 20:13

View original

2 replies

Userlevel 4
Badge +3

Hey @pbrady ,

As you guessed, you will likely need to do some extra work here to capture this select value. The best way to do this would likely be using Heap’s Snapshots feature to capture this value. You can choose to capture upon entry or upon submission (each of those have tradeoffs). You can find more about snapshots here. I hope that helps :) 

Userlevel 1
Badge +1

Unfortunately, it turns out that Snapshots have been disabled in our acct.  But I think we can get at the data via JS, and forward it to Heap.

Thanks for the help regardless!

 

Reply