amplitudejs icon indicating copy to clipboard operation
amplitudejs copied to clipboard

Initialize on a Specific Element

Open jaydrogers opened this issue 3 years ago • 0 comments

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.

jaydrogers avatar May 03 '22 17:05 jaydrogers