Open andrewlangston opened 3 weeks ago
Hi @andrewlangston, thanks for the feature request, that makes sense!
Hopefully we can make this a non-breaking change – I was thinking that we could add the button element as the second argument in the callback, after the event.
@matus-tomlein good call, makes sense!
I've submitted a PR with the change here
When that's released, where is the right place to update documentation? Is it https://github.com/snowplow/documentation/blob/main/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/button-click/index.md?
Is your feature request related to a problem? Please describe. But button click tracking plugin appears to have an undocumented (at least on docs.snowplow.io: https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/button-click/) feature for attaching dynamic contexts to each button click, similar to the link click tracking plugin.
However, the button click tracking plugin's dynamic context functions take only the button click event as an argument: https://github.com/snowplow/snowplow-javascript-tracker/blob/master/plugins/browser-plugin-button-click-tracking/src/api.ts#L105. This is less flexible than the link click tracking plugin's ability to take the clicked element as an argument to dynamic context functions: https://github.com/snowplow/snowplow-javascript-tracker/blob/master/plugins/browser-plugin-link-click-tracking/src/index.ts#L279
Describe the solution you'd like
Describe alternatives you've considered N/A
Additional context N/A