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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
tmcdevitt
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 (https://github.com/Microsoft/PowerBI-JavaScript/wiki/Handling-Events) 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.

 

Thanks!

 

- Terence

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

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,

Dale

 

 

 

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

 

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/35144029-support-for-google-tag-m...

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.