michaelcarter / mixpanel-data-export-js

Mixpanel data export js
91 stars 38 forks source link

segmentation/sum not working for me #27

Open ploner opened 8 years ago

ploner commented 8 years ago

Hi, I tried to use the aggregation on the segmentation, but it did not work. Call:

panel.sumSegmentation({
  from_date: "2016-11-01",
  to_date: "2016-11-09",
  event: "View",
  type: "general",
  unit: "day",
  on: 'number(properties["Stat"])'
}).then(function(data) {
...

I also tried to add the parameter action:'sum'.

On the other side a dirct http call works fine, using https://...@mixpanel.com/api/2.0/segmentation/sum?event=View&from_date=2016-11-01&to_date=2016-11-09&unit=day&type=general&action=sum&on=number%28properties%5B%22Stat%22%5D%29&".

Any help appreciated! Thx

Coqueiro commented 8 years ago

segmentation is not working for me, too MP.segmentation({ event: 'Page View', from_date: '2016-11-04', to_date: '2016-11-04', on: 'properties["gts_Source"]' }).then((data) => { segmentation = data; });

michaelcarter commented 7 years ago

@ploner @Coqueiro Is this still an issue for either of you? Sad to say it seems to be working fine for me locally. What do you get back from the API?

ploner commented 7 years ago

@michaelcarter @Coqueiro I did not try anymore. In the meanwhile I wrote an R package which also handles the endpoints segmentation/sum and segmentation/average (https://github.com/ploner/RMixpanel/blob/master/man/mixpanelGetSegmentation.Rd). But you might need a JS implementation.