Home

Get returning user count

%3CLINGO-SUB%20id%3D%22lingo-sub-582468%22%20slang%3D%22en-US%22%3EGet%20returning%20user%20count%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-582468%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20this%20request%20url%20I%20can%20get%20the%20total%20unique%20user%20count%3A%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fapi.applicationinsights.io%2Fv1%2Fapps%2F%5BapplicationID%5D%2Fmetrics%2Fusers%2Fcount%3Ftimespan%3D2019-05-16T00%3A00%3A00Z%2F2019-05-17T00%3A00%3A00Z%26amp%3Bsegment%3Dclient%2FcountryOrRegion%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fapi.applicationinsights.io%2Fv1%2Fapps%2F%5BapplicationID%5D%2Fmetrics%2Fusers%2Fcount%3Ftimespan%3D2019-05-16T00%3A00%3A00Z%2F2019-05-17T00%3A00%3A00Z%26amp%3Bsegment%3Dclient%2FcountryOrRegion%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20used%20this%20page%20to%20get%20that%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdev.applicationinsights.io%2Fapiexplorer%2Fmetrics%3FmetricId%3Dusers%252Fcount%26amp%3Btimespan%3DP7D%26amp%3Baggregation%3Dunique%26amp%3Bsegment%3Dclient%252FcountryOrRegion%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdev.applicationinsights.io%2Fapiexplorer%2Fmetrics%3FmetricId%3Dusers%252Fcount%26amp%3Btimespan%3DP7D%26amp%3Baggregation%3Dunique%26amp%3Bsegment%3Dclient%252FcountryOrRegion%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20now%20I%20want%20to%20get%20the%20Returning%20users%20count%2C%20so%20I%20want%20to%20know%20how%20many%20of%20the%20unique%20users%20are%20returning%20users.%20How%20do%20I%20query%20that%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20been%20looking%20through%20the%20azure%20application%20insights%20blades%20and%20metrics%20to%20get%20that%2C%20the%20only%20place%20I%20could%20find%20it%20was%20under%20Usage%20%3D%26gt%3B%20More%20%3D%26gt%3B%20New%2C%20Returning%20and%20Churrned%20Users.%20It%20seems%20to%20be%20querying%20what%20I%20want%3A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F114171i29403100F2F705AD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22returningusers.PNG%22%20title%3D%22returningusers.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20want%20to%20get%20this%20query%20for%20myself%20so%20I%20can%20get%20the%20Returning%20users%20count%20on%20a%20daily%20bases%2C%20via%20the%20api.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20clicking%20on%20Edit%20at%20the%20top%20of%20the%20page%2C%20I%20can%20edit%20each%20individual%20item%20on%20the%20page%2C%20so%20I%20can%20now%20also%20edit%20the%20graph.%20When%20I%20do%20that%2C%20I%20can%20see%20the%20query%2C%20which%20is%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CPRE%3E%3CSPAN%3Elet%3C%2FSPAN%3E%20%3CSPAN%3Etime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E%2C%20%5B%3C%2FSPAN%3E%3CSPAN%3E%22Active%20Users%22%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3D%20%3C%2FSPAN%3E%3CSPAN%3Es%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%20%2B%20%3C%2FSPAN%3E%3CSPAN%3ENewUsers%3C%2FSPAN%3E%3CSPAN%3E%2C%20%5B%3C%2FSPAN%3E%3CSPAN%3E%22Returning%20Users%22%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3D%20%3C%2FSPAN%3E%3CSPAN%3Es%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%2C%20%5B%3C%2FSPAN%3E%3CSPAN%3E%22Lost%20Users%22%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3D%20%3C%2FSPAN%3E%3CSPAN%3EChurnedUsers%3C%2FSPAN%3E%3CSPAN%3E%2C%20%5B%3C%2FSPAN%3E%3CSPAN%3E%22New%20Users%22%3C%2FSPAN%3E%3CSPAN%3E%5D%20%3D%20%3C%2FSPAN%3E%3CSPAN%3ENewUsers%3C%2FSPAN%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAwesome%2C%20I%20thought%2C%20but%20unfortunately%20it%20does%20not%20work%20correctly%2C%20there%20is%20even%20a%20button%20to%20open%20the%20query%20in%20the%20Query%20Logs%20View.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20723px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F114172i9E0F02D833967F87%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22queryLogsView.PNG%22%20title%3D%22queryLogsView.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20I%20don't%20really%20get%20how%20the%20query%20is%20build%20to%20get%20Returning%20Users.%20According%20to%20the%20query%20this%20should%20be%20defiend%20by%20%22s1%22%20which%20I%20cannot%20see%20to%20be%20defined%20anywhere.%20Also%2C%20I%20am%20a%20noob%20to%20this%20query%20language%2C%20so%20I%20would%20highly%20appreciate%20if%20someone%20could%20tell%20me%20how%20to%20adjust%20this%20query%20so%20that%20it%20only%20provides%20the%20Returning%20users%20count%20using%20a%20start%20and%20end%20date.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-582468%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%20Insights%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuery%20Language%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
RuudFaessen
Occasional Visitor

Hi,

 

With this request url I can get the total unique user count:

https://api.applicationinsights.io/v1/apps/[applicationID]/metrics/users/count?timespan=2019-05-16T0...

 

I used this page to get that: https://dev.applicationinsights.io/apiexplorer/metrics?metricId=users%2Fcount&timespan=P7D&aggregati...

 

But now I want to get the Returning users count, so I want to know how many of the unique users are returning users. How do I query that?

 

I have been looking through the azure application insights blades and metrics to get that, the only place I could find it was under Usage => More => New, Returning and Churrned Users. It seems to be querying what I want:returningusers.PNG

 

So I want to get this query for myself so I can get the Returning users count on a daily bases, via the api.

 

When clicking on Edit at the top of the page, I can edit each individual item on the page, so I can now also edit the graph. When I do that, I can see the query, which is as follows:

 

let timeRange = {TimeRange};
let monthDefinition = {Metric};
let hlls = union customEvents, pageViews
| where timestamp >= startofmonth(now() - timeRange - 2 * monthDefinition)
| where name in ({Activities}) or '*' in ({Activities})
{OtherFilters}
| summarize Hlls = hll(user_Id) by bin(timestamp, 1d)
| project DaysToMerge = timestamp, Hlls;
let churnSeriesWithHllsToInclude = materialize(range d from 0d to timeRange step 1d
| extend Day = startofday(now() - d)
| extend R = range(0d, monthDefinition - 1d, 1d)
| mvexpand R
| extend ThisMonth = Day - totimespan(R)
| extend LastMonth = Day - monthDefinition - totimespan(R)
| project Day, ThisMonth, LastMonth);
churnSeriesWithHllsToInclude
| extend DaysToMerge = ThisMonth
| join kind= inner (hlls) on DaysToMerge
| project Day, ThisMonthHlls = Hlls
| union (
churnSeriesWithHllsToInclude
| extend DaysToMerge = LastMonth
| join kind= inner (hlls) on DaysToMerge
| project Day, LastMonthHlls = Hlls)
| summarize ThisMonth = hll_merge(ThisMonthHlls), LastMonth = hll_merge(LastMonthHlls) by Day
| evaluate dcount_intersect(ThisMonth, LastMonth)
| extend NewUsers = s0 - s1
| extend ChurnedUsers = -1 * (dcount_hll(LastMonth) - s1) // Last Months Users - Returning Users
| project Day, ["Active Users"] = s1 + NewUsers, ["Returning Users"] = s1, ["Lost Users"] = ChurnedUsers, ["New Users"] = NewUsers

 

Awesome, I thought, but unfortunately it does not work correctly, there is even a button to open the query in the Query Logs View.

 

 

queryLogsView.PNG

 

But I don't really get how the query is build to get Returning Users. According to the query this should be defiend by "s1" which I cannot see to be defined anywhere. Also, I am a noob to this query language, so I would highly appreciate if someone could tell me how to adjust this query so that it only provides the Returning users count using a start and end date.

Related Conversations
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
2 Replies
*Updated 9/3* Syncing in Microsoft Edge Preview Channels
Elliot Kirk in Articles on
202 Replies
Early preview of Microsoft Edge group policies
Sean Lyndersay in Discussions on
65 Replies