danscan / rn-redux-mixpanel

Configurable redux middleware that sends your actions & user profile data to Mixpanel. Works with React Native!
67 stars 14 forks source link

Event properties #2

Closed pewallin closed 8 years ago

pewallin commented 9 years ago

Are you in the process of adding them? Noticed that trackEvent takes a eventData object. Maybe add it to the middlware signature as "selectProperties = ()=>null"? and

const distinctId = selectDistinctId(action, state)
const properties = selectProperties(action, state)

// Track action event with Mixpanel
trackEvent({
  token,
  distinctId,
  eventName: action.type,
  eventData: properties
})
danscan commented 9 years ago

Really good idea @pewallin . I hadn't added it yet, since the properties I was initially trying to send were overflowing the URL char limit, even after base64 encoding (as Mixpanel's HTTP API requires).

danscan commented 9 years ago

If you want to create a PR, I'll gladly accept; otherwise I can get to it tomorrow.

danscan commented 8 years ago

Forgot to close this when we merged #3