Skip to content

Conversation

@dmitriy-kiriyenko
Copy link

For my particular case I need to pull off the element more properties than pulled by default (id, className, section). To be more precise, I want to pull whole dataset.

The most straightforward way to do so is overriding eventProperties, which is used in trackClicks, trackSubmits and trackChanges.

However in its current state I can override trackClick and others, but that would be too much of a monkey patch.

I believe making eventProperties overridable won't hurt anyone and will improve the options to customize events data.

For my particular case I need to pull off the element more properties
than pulled by default (`id`, `className`, `section`). To be more
precise, I want to pull whole `dataset`.

The most straightforward way to do so is overriding `eventProperties`,
which is used in `trackClicks`, `trackSubmits` and `trackChanges`.

However in its current state I can override `trackClick` and others,
but that would be too much of a monkey patch.

I believe making `eventProperties` overridable won't hurt anyone and will
improve the options to customize events data.
@dmitriy-kiriyenko
Copy link
Author

@ankane ?

@ankane
Copy link
Owner

ankane commented Oct 6, 2020

Hey @dmitriy-kiriyenko, thanks for the PR, and sorry for the delay (have been focused on other projects). This makes sense to me. Let's add it as a config option instead of a separate method.

ahoy.configure({
  eventProperties: function(e) { ... }
})

@imcodingideas
Copy link

@ankane if I finish this one off, would you be willing to merge this in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants