Solved

Is there a way to capture toggle events without creating a custom event?

  • 22 May 2023
  • 1 reply
  • 33 views

Badge

Hi,

I’m interested to learn how to capture toggle events without creating a custom event. Have any ideas ? Is snapshots the answer? If yes, can you share more details? Like what would I require my Engineer to add in the code?

icon

Best answer by GlennS 22 May 2023, 19:57

View original

1 reply

Userlevel 2
Badge +1

Hi, @Heaper_Reaper,

Is this for Web or mobile?

For Web, Heap automatically captures click events so clicks on a toggle should be captured.  If you want to capture the state of the toggle or some text on the page associated with the toggle, that will require a snapshot.  A Text in Element snapshot will capture text on the page. If you need to capture the state of the toggle, you will probably need a JavaScript snapshot assuming the state is reflected in the DOM.  You should be able to configure both types of snapshots from the Heap UI without needing to add code to your site.  The following docs describe how to configure snapshots:

https://help.heap.io/definitions/snapshots/snapshots-overview/

https://developers.heap.io/docs/executing-javascript-using-snapshots

Reply