Question on xapi + wordpress

Hello, I'm unsuccessfully trying to use xapi with a wordpress installation.

I read https://h5p.org/documentation/x-api and was trying:
Example
To try this out type the following in your browser's console when using an H5P object on a website:

H5P.externalDispatcher.on('xAPI', function (event) {
console.log(event.data.statement); });

However, console returns:Undefined

I'm trying it on a localhost, on a page with h5p content (wordpress). Same message either with or without being logged-in.
What am I missing?

falcon's picture

Hello, how are you adding the H5P content to the page you are visiting?

Hi Falcon, by using:  [h5p id="4"] (which is currently my excercise id).

falcon's picture

Ok, make sure you're running the code inside the correct window. The H5P is probably run through an iFrame.