你如何在 Mixpanel JQL API 中引用今天的日期?
How do you reference today's date in Mixpanel JQL API?
event = "function main(){return Events({from_date: '2020-11-01', to_date: ... , event_selectors: [{event:'Search'}]}).groupByUser(['properties.Completion'], mixpanel.reducer.count())}"
在“to_date”后加什么可以自动拉取今天的日期?
您可以为今天添加一个变量,如下例所示:
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());
}
event = "function main(){return Events({from_date: '2020-11-01', to_date: ... , event_selectors: [{event:'Search'}]}).groupByUser(['properties.Completion'], mixpanel.reducer.count())}"
在“to_date”后加什么可以自动拉取今天的日期?
您可以为今天添加一个变量,如下例所示:
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());
}