Reputation: 83
event = "function main(){return Events({from_date: '2020-11-01', to_date: ... , event_selectors: [{event:'Search'}]}).groupByUser(['properties.Completion'], mixpanel.reducer.count())}"
What should I put after "to_date" to pull automatically pull today's date?
Upvotes: 0
Views: 443
Reputation: 36
You can add a variable for today like in the following example:
function main() {
//Get today's date
var today = new Date ( (new Date())).toISOString().split('T')[0];
return Events({
from_date: '2020-11-01',
to_date: today,
})
.groupByUser(['properties.Completion'], mixpanel.reducer.count());
}
Upvotes: 2