Forum Discussion
JeffForrer
9 months agoCommunity Member
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.
Than...
Nedim
6 months agoCommunity Member
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.