microsoft / ApplicationInsights-JS

Microsoft Application Insights SDK for JavaScript
MIT License
650 stars 240 forks source link

applicationinsights-clickanalytics-js extension should allow defining which element types clicks are tracked on #1706

Open gabriel-kohen-by opened 3 years ago

gabriel-kohen-by commented 3 years ago

Is your feature request related to a problem? Please describe. In many frameworks (Under ReactJS/Angular/Vue), components are made out of elements that are not traditionally clickable. Example: Combo boxes that are defined in their popup with LI(List). We want to be able to track such clicked elements as well as the out of the box ones. See here: https://github.com/microsoft/ApplicationInsights-JS/blob/master/extensions/applicationinsights-clickanalytics-js/src/handlers/AutoCaptureHandler.ts#L58 Example of such popular framework is React's Material UI: https://v4.mui.com/

Describe the solution you'd like There should be a way to define in the configuration of this extension which additional elements types can be tracked.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context We had to add explicit event handlers to all these components to fire AI custom events. That creates a pretty big pollution to our code.

itpropro commented 2 years ago

Any update on this feature? I have a customer project that consists only of custom elements based on divs. We have to use an additional framework for click tracking as long as we cannot specify either additional elements types, classes or id's.

MSNev commented 2 years ago

Hi @itpropro, Sorry, No we have not scheduled this work yet so I don't have a possible ETA and the person how was originally allocated to this plugin is no longer with the team 😢 so we need to backfill their position as well.

scmarquez commented 1 year ago

Hi!. Any update on this??

MSNev commented 1 year ago

Sorry, no we have not had any cycles to schedule this yet as we have been working on other items. And it's probably still months away before we will have any cycles (i.e. we have already planned out to the end of march '23)

Do you want to take a go at making the default value for clickCaptureElements configurable via the passed in IClickAnalyticsConfiguration?

It should be straight forward, but it will probably need additional test coverage (ie. I suspect that there will be more test code than actual production code required for this change).

cherullo commented 6 months ago

I find this feature important and it's been regularly mentioned (#2318 and #2136). Anyway we can bump this?