User Analytics - Activity Metrics in Application Insights - what is the logic of the plugin

Copper Contributor

Hello everybody,

I have several sites that contain games on them. I track all sites by one Application Insights resource. Now I want to calculate retention rate of each game on every site (or on all sites overall). 
To figure this out I used this plugin:
https://docs.microsoft.com/en-us/azure/kusto/query/new-activity-metrics-plugin

 

My question here is - does measure 'dcount_retained_users' count for site and game simultaneously or only for site?
I want to know how many people come back and play the same game on the same site as they did at their first week.


Here is my script below. Please help me to understand the plugin and how i can solve my problem:

let start0 = ago(90d);
let end = ago(1d);
let w0 = customEvents
| where timestamp > start0 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start0, end, 7d, start0, game, site);
let start1 = start0+7d;
let w1 = customEvents
| where timestamp > start1 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start1, end, 7d, start1, game, site);
let start2 = start1+7d;
let w2 = customEvents
| where timestamp > start2 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start2, end, 7d, start2, game, site);
let start3 = start2+7d;
let w3 = customEvents
| where timestamp > start3 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start3, end, 7d, start3, game, site);
let start4 = start3+7d;
let w4 = customEvents
| where timestamp > start4 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start4, end, 7d, start4, game, site);
let start5 = start4+7d;
let w5 = customEvents
| where timestamp > start5 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start5, end, 7d, start5, game, site);
let start6 = start5+7d;
let w6 = customEvents
| where timestamp > start6 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start6, end, 7d, start6, game, site);
let start7 = start6+7d;
let w7 = customEvents
| where timestamp > start7 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start7, end, 7d, start7, game, site);
let start8 = start7+7d;
let w8 = customEvents
| where timestamp > start8 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start8, end, 7d, start8, game, site);
let start9 = start8+7d;
let w9 = customEvents
| where timestamp > start9 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start9, end, 7d, start9, game, site);
let start10 = start9+7d;
let w10 = customEvents
| where timestamp > start10 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start10, end, 7d, start10, game, site);
let start11 = start10+7d;
let w11 = customEvents
| where timestamp > start11 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start11, end, 7d, start11, game, site);
let start12 = start11+7d;
let w12 = customEvents
| where timestamp > start12 and name == "start"
| extend site = tostring(customDimensions.['site'])
| extend game = tostring(customDimensions.['game'])
| evaluate new_activity_metrics(user_Id , timestamp, start12, end, 7d, start12, game, site);
let sourceTable = union w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12;
sourceTable
| project from_timestamp,to_timestamp,site,game,dcount_new_values,dcount_retained_values,dcount_churn_values,retention_rate,churn_rate
0 Replies