listen for Usersnap send event (or equivalent)

221 Views Asked by At

I'm using Usersnap (https://usersnap.com/) for user feedback. I need to know when the user has used the feedback button, but there doesn't seem to be a way via the api.

If you haven't used Usersnap the api places an iframe with a feedback button.

when you click the button, an overlay is placed over the site so the user can drag a selector box over their issue

Then then are presented a modal that they can add message and email.

After submitting, they get a success modal.

Ideally I would like to know when the overlay is there and when the success modal is there.

As you can see from the code they provide an on open, for when the button is clicked.

And an on close, however the close event is the first modal that opens not the last one :/

Any suggestions

    window.onUsersnapCXLoad = function (api) {
      api.init();
      api.on("open", function (d) {
        console.log("====> open");
        if (customDataRef.current) {
          d.api.setValue("custom", bigIntToString(customDataRef.current));
        }
      });


      api.on("close", () => {
        console.log("====> close:");
      });
    };
  }
1

There are 1 best solutions below

0
On

What I saw in their documentation, their is submit event:

api.on("submit", () => {
   console.log("====> submit:");
});