Skip to main content
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Advocate II
Advocate II

Is anyone actually using JavaScript event handlers in embed mode?

We'd like to get more insights into what users are doing in our embedded PBI reports.


We know there's an event model in place for this ( and we're already using the "loaded" event in order to show/hide "wait" spinners.


The above works fine but when we started to dig into other things we can do, the documentation/functionality is a bit lacking. Specifically, we'd like to know when users are actually interacting with the report by drilling through, exporting, etc.


We see that there's the "commandTriggered" event and it appears to be tied to menu items (like "Export Data" or "Show Data") but our event handlers aren't getting called when users click these menu items. Based on the documentation, it sounds like this may only happen when users click on *custom* menu items, perhaps not the OOTB items?


So, we're just trying to get more clarity on what's really possible. The Github docs haven't really changed much in a while so I'm not sure if that also means the functionality in the JS library hasn't changed or it has and perhaps the docs haven't been updated to match.


If someone's got a working example of capturing user events, I'd love to see it.




- Terence


Hi Terence,


There is a live demo here. You can try all the functions and view the events. I would suggest you create ideas here for some events. 


Best Regards,





Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Dale. The sandbox is definitely interesting and we've played with it before but I'm not really getting what I need from that. It feels like what I'm after doesn't exist yet, so perhaps I need to log it as an idea.


The "commandTriggered" event sounded promising, but based on what I'm seeing that only applies to *custom* events that are added to the menu. So, it looks like I have no hooks into handling OOTB events like "Export Data" or "Spotlight".


In general, it feels like PBI could be better at allowing analytics "hooks" so that we can be sending events to something like Google Analytics. Even better - allow us to enter a Google Tag Manager container ID somewhere in our config and we can just create custom tags in GTM to handle these types of things.

I've posted a PBI Idea for the above. If anyone else is interested, please vote


Helpful resources

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.


Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.