Initialize on a Specific Element
Discussed in https://github.com/serversideup/amplitudejs/discussions/485
Originally posted by jaydrogers May 3, 2022
👉 Describe the problem
Currently AmplitudeJS binds to the entire page. This can be overkill and needs to be optional. Sometimes you only want to bind events to elements within a certain element.
👥 Problem evidence & reach
Any user who wants to narrow down and scope the binding of events to a certain element. Specific Requests https://github.com/serversideup/amplitudejs/issues/334 https://community.serversideup.net/t/multi-players-loadad-by-external-js/584/2
🥰 Describe the "impact" on users?
We can limit the scope of where AmplitudeJS is bound along with opening the door to making re-usable web components.
🏆 How to solve this problem
Allow the user to pass an element, identifier, etc. when initializing AmplitudeJS.
💯 How do we validate the problem is solved?
Users can bind AmplitudeJS events to a specific element and bind multiple times per page for multiple players.