Forum Discussion

JeffForrer's avatar
JeffForrer
Community Member
8 months ago

Detect user interaction with Player components?

Is there a way, perhaps using JS, to detect when a user clicks the Menu, Glossary, Resources etc.?

I am using xAPI to report other data to a LRS but also looking to see if this is possible.

Thank you.

  • by when, do you mans the elapsed time of the project?

    I always use my own Menu, Glossary and etc. Not because the built-in options don't work, but mostly because I can't stand the thought of my work looking like it came off the shelf in a box.  It also makes it a lot easier to do this sort of thing with triggers.

    • JeffForrer's avatar
      JeffForrer
      Community Member

      Sorry I missed this, thanks for your reply.  I agree on the using own Menu etc. however this is a client with a set interface.  They want to track clicks on the Hamburger Menu, Glossary, Resources etc. and send to their LRS so they know if users are using them.

  • Hi Jeff,

    I don't know if you are still looking for a solution or if you may have already found one, but I wanted to share this thought to give you some ideas regarding your inquiry.

    If I wanted to know if the hamburger menu was clicked, I would probably use this JavaScript code in an Execute JavaScript trigger when the timeline starts on this slide

    let counter = 0;
    const hamburger = document.getElementById('hamburger');
    hamburger.addEventListener('click', () => {
      counter++;
      setVar("counter", counter)
      console.log(`Hamburger clicked ${counter} times`);
    });

    Now you can send a custom xAPI statement when the "counter" variable in Storyline changes:




    When tested in ScormCloud I can see that the hamburger menu was clicked 5 times.



  • JeffForrer's avatar
    JeffForrer
    Community Member

    Hi Nedim, thank you so much for this. I was looking for this a few months ago but my client decided it wasn't worth the effort. Now that I know this is an option, I will try it out.  I really appreciate it.  Thank you.