Question

JQL $session_start is not an event

  • 13 November 2019
  • 5 replies
  • 159 views

Userlevel 2
Badge

Hi Mixpanel,

I would like to generate jql query based on this :

here is JQL query :

params = {
  type : 'unique',
  email_is_set: '( defined (properties["$email"]))',
  email_is_not_set: '( not defined (properties["$email"]))',
  events : [{event: "$session_start" }]
};
var groupKeys = [mixpanel.numeric_bucket('event.time', mixpanel.daily_time_buckets)]
function main() {
  var collection = join(
    Events({
      from_date: "2019-10-01",
      to_date: "2019-10-12",
      event_selectors: params.events,
    }),
    People(),
    {
      type:"left",
      selectors:[{selector:' defined (user["$email"]) '}]
    }
  )
  if (params.type == 'total')
    return collection
    .groupBy(groupKeys, mixpanel.reducer.count());
  else if (params.type == 'unique')
    return collection
    .groupByUser(groupKeys, mixpanel.reducer.null()) 
    .groupBy([mixpanel.slice('key', 1)], mixpanel.reducer.count());
}

but it seems that "$session_start" is not belong to any "event". Do you have any JQL suggestion to get this $session_start reports?


Thank you



5 replies

Userlevel 3
Badge

@ichbin maybe trying "session_start" instead of "$session_start" ?


Userlevel 2
Badge

still no luck.


Userlevel 3
Badge

@ichbin hmmm this a bit frustrating. By any chance can you share any error messages you get? Might be helpful


Userlevel 2
Badge

There is no error message, the result was just empty. You can try this query to another event but not `$session_start` or even `session_start`. Did you try on your own to get session total and unique report?


Userlevel 3
Badge

@ichbin I tried it out and it I got the same empty return. It looks like the new session feature might not be accessible in JQL.

curious to know what information you wanted to get from this JQL that was not in the UI? Might be worth logging an idea for it


Reply