Skip to content

Instantly share code, notes, and snippets.

@madhur-smaato
Last active May 21, 2025 09:43
Show Gist options
  • Save madhur-smaato/2f02a93f8251cf21b003f4e3fdfeffc2 to your computer and use it in GitHub Desktop.
Save madhur-smaato/2f02a93f8251cf21b003f4e3fdfeffc2 to your computer and use it in GitHub Desktop.
{
"cohorts": [
{
"id": 360003,
"name": "ATOM 3.6.0.3-TDS",
"threshold": 1,
"history": {
"totalCount": ">0",
"totalTime": ">0"
}
},
{
"id": 100001,
"name": "Night Owl",
"threshold": 1000,
"history": {
"dors": [
{
"slots": [
0,
1,
2
],
"any": {
"parts": {
"slots": [
0
],
"all": {
"avgTime": "|, >-10%, <50%",
"totalTime": "&, <100"
}
}
}
}
]
}
},
{
"id": 1000099,
"name": "Custom Gamer",
"cohort_ttl": 3600,
"custom": {
"total_count": 3,
"match_count": 1,
"ordered": 0,
"lookup_range_ms": 2000,
"events": [
{
"name": "Game Purchase",
"value": "Minecraft"
},
{
"name": "Donation",
"value": "10$"
}
]
}
},
{
"id": 100005,
"name": "Impulsive",
"threshold": 1,
"history": {
"totalCount": ">30"
}
},
{
"id": 100007,
"name": "Employed",
"threshold": 1000,
"history": {
"dands": [
{
"slots": [
-1
],
"any": {
"parts": {
"totalCount": ">3",
"slots": [
0,
1,
3
]
}
}
},
{
"slots": [
-1
],
"any": {
"parts": {
"totalCount": "=0",
"slots": [
2
]
}
}
}
]
}
},
{
"id": 100009,
"name": "Loyality",
"threshold": 1,
"history": {
"totalCount": ">10"
}
},
{
"id": 100010,
"name": "Bored people",
"threshold": 1,
"history": {
"dors": [
{
"slots": [
0,
1,
2,
3
],
"all": {
"totalCount": ">0"
}
}
]
}
},
{
"id": 100003,
"name": "Active Gamer",
"threshold": 1,
"history": {
"totalCount": ">0",
"totalTime": ">0"
}
},
{
"id": 100011,
"name": "Age 25-44",
"threshold": 50,
"appsBasedClassification": {
"identifier": "age_25_44"
}
},
{
"id": 100012,
"name": "Age 16-24",
"threshold": 50,
"appsBasedClassification": {
"identifier": "age_16_24"
}
},
{
"id": 100013,
"name": "Age 45+",
"threshold": 50,
"appsBasedClassification": {
"identifier": "age_45_plus"
}
},
{
"id": 100014,
"name": "Male",
"threshold": 50,
"appsBasedClassification": {
"identifier": "gender_male"
}
},
{
"id": 100015,
"name": "Female",
"threshold": 50,
"appsBasedClassification": {
"identifier": "gender_female"
}
},
{
"id": 100031,
"name": "At Home",
"threshold": 51,
"signals": {
"battery": {
"is_charging": {
"weight": 2,
"value": 1
},
"very_low": {
"weight": 3,
"rule": "<5",
"value": 0
},
"low": {
"weight": 1,
"rule": "&, >5, <15",
"value": 0
},
"battery_saver": {
"weight": 2,
"value": 0
}
},
"reachability": {
"wifi_on": {
"weight": 2,
"value": 1
},
"offline": {
"weight": 2,
"value": 0
},
"5g": {
"weight": 2,
"value": 0
},
"4g": {
"weight": 2,
"value": 0
},
"3g": {
"weight": 2,
"value": 0
},
"2g": {
"weight": 2,
"value": 0
}
},
"luminosity": {
"very_bright": {
"weight": 2,
"rule": ">95",
"value": 0
}
}
}
},
{
"id": 100032,
"name": "At Work",
"threshold": 51,
"signals": {
"battery": {
"is_charging": {
"weight": 2,
"value": 1
},
"very_low": {
"weight": 3,
"rule": "<5",
"value": 0
},
"low": {
"weight": 1,
"rule": "&, >5, <15",
"value": 0
},
"battery_saver": {
"weight": 2,
"value": 0
}
},
"reachability": {
"wifi_on": {
"weight": 2,
"value": 1
},
"offline": {
"weight": 2,
"value": 0
},
"5g": {
"weight": 2,
"value": 0
},
"4g": {
"weight": 2,
"value": 0
},
"3g": {
"weight": 2,
"value": 0
},
"2g": {
"weight": 2,
"value": 0
}
}
}
},
{
"id": 100033,
"name": "Not At Home",
"threshold": 51,
"signals": {
"battery": {
"is_charging": {
"weight": 2,
"value": 0
},
"very_low": {
"weight": 3,
"rule": "<5",
"value": 1
},
"low": {
"weight": 1,
"rule": "&, >5, <15",
"value": 1
},
"battery_saver": {
"weight": 2,
"value": 1
}
},
"reachability": {
"wifi_on": {
"weight": 2,
"value": 0
},
"offline": {
"weight": 2,
"value": 1
},
"5g": {
"weight": 2,
"value": 1
},
"4g": {
"weight": 2,
"value": 1
},
"3g": {
"weight": 2,
"value": 1
},
"2g": {
"weight": 2,
"value": 1
}
},
"luminosity": {
"very_bright": {
"weight": 2,
"rule": ">95",
"value": 1
}
}
}
},
{
"id": 100034,
"name": "Not at work",
"threshold": 51,
"signals": {
"battery": {
"is_charging": {
"weight": 2,
"value": 0
},
"very_low": {
"weight": 3,
"rule": "<5",
"value": 1
},
"low": {
"weight": 1,
"rule": "&, >5, <15",
"value": 1
},
"battery_saver": {
"weight": 2,
"value": 1
}
},
"reachability": {
"wifi_on": {
"weight": 2,
"value": 0
},
"offline": {
"weight": 2,
"value": 1
},
"5g": {
"weight": 2,
"value": 1
},
"4g": {
"weight": 2,
"value": 1
},
"3g": {
"weight": 2,
"value": 1
},
"2g": {
"weight": 2,
"value": 1
}
}
}
},
{
"id": 100035,
"name": "High Attention",
"threshold": 51,
"signals": {
"battery": {
"is_charging": {
"weight": 2,
"value": 0
},
"very_low": {
"weight": 3,
"rule": "<5",
"value": 0
},
"low": {
"weight": 1,
"rule": "&, >5, <15",
"value": 1
},
"battery_saver": {
"weight": 2,
"value": 0
}
},
"reachability": {
"wifi_on": {
"weight": 2,
"value": 0
},
"offline": {
"weight": 2,
"value": 1
},
"5g": {
"weight": 2,
"value": 1
},
"4g": {
"weight": 2,
"value": 1
},
"3g": {
"weight": 2,
"value": 1
},
"2g": {
"weight": 2,
"value": 1
}
},
"luminosity": {
"very_bright": {
"weight": 2,
"rule": ">95",
"value": 1
}
}
}
},
{
"id": 100036,
"name": "Mid Attention",
"threshold": 51,
"signals": {
"battery": {
"is_charging": {
"weight": 2,
"value": 1
},
"very_low": {
"weight": 3,
"rule": "<5",
"value": 0
},
"low": {
"weight": 1,
"rule": "&, >5, <15",
"value": 1
},
"battery_saver": {
"weight": 2,
"value": 0
}
},
"reachability": {
"wifi_on": {
"weight": 2,
"value": 0
},
"offline": {
"weight": 2,
"value": 1
},
"5g": {
"weight": 2,
"value": 1
},
"4g": {
"weight": 2,
"value": 1
},
"3g": {
"weight": 2,
"value": 1
},
"2g": {
"weight": 2,
"value": 1
}
},
"luminosity": {
"very_bright": {
"weight": 2,
"rule": ">95",
"value": 1
}
}
}
},
{
"id": 100037,
"name": "Low Attention",
"threshold": 51,
"signals": {
"battery": {
"is_charging": {
"weight": 2,
"value": 1
},
"very_low": {
"weight": 3,
"rule": "<5",
"value": 1
},
"low": {
"weight": 1,
"rule": "&, >5, <15",
"value": 0
},
"battery_saver": {
"weight": 2,
"value": 1
}
},
"reachability": {
"wifi_on": {
"weight": 2,
"value": 0
},
"offline": {
"weight": 2,
"value": 1
},
"5g": {
"weight": 2,
"value": 1
},
"4g": {
"weight": 2,
"value": 1
},
"3g": {
"weight": 2,
"value": 1
},
"2g": {
"weight": 2,
"value": 1
}
},
"luminosity": {
"very_bright": {
"weight": 2,
"rule": ">95",
"value": 1
}
}
}
},
{
"id": 100038,
"name": "No Attention",
"threshold": 51,
"signals": {
"battery": {
"is_charging": {
"weight": 2,
"value": 0
},
"very_low": {
"weight": 3,
"rule": "<5",
"value": 0
},
"low": {
"weight": 1,
"rule": "&, >5, <15",
"value": 0
},
"battery_saver": {
"weight": 2,
"value": 0
}
},
"reachability": {
"wifi_on": {
"weight": 2,
"value": 0
},
"offline": {
"weight": 2,
"value": 1
},
"5g": {
"weight": 2,
"value": 1
},
"4g": {
"weight": 2,
"value": 1
},
"3g": {
"weight": 2,
"value": 1
},
"2g": {
"weight": 2,
"value": 1
}
},
"luminosity": {
"very_bright": {
"weight": 2,
"rule": ">95",
"value": 1
}
}
}
},
{
"id": 500016,
"name": "Fact_Age_18_24",
"threshold": 50,
"ml_model": {
"name": "Fact_Age_18_24",
"version": "1.0.0",
"calculationIntervalInSeconds": 15,
"isActive": true,
"url": "https://configuration.atom.ai.verve.com/api/v3/atom/model?bundleId=de.tvsmiles.app&model=Fact_Age_18_24_1.0.0.tflite&apiKey=ml_v8",
"providers": [
{
"statement": "WITH base as (SELECT CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Frau / Sie', 'Mrs / She') then 1 else 0 end as Fact_Female, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Herr / Er', 'Mr / He') then 1 else 0 end as Fact_Male, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '18-24' then 1 else 0 end as Fact_Age_18_24, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '25-44' then 1 else 0 end as Fact_Age_25_44, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '45+' then 1 else 0 end as Fact_Age_45p FROM vrv_atom_adSessionData WHERE ad_session_data like \"%SurveyData%\" ORDER BY ROWID DESC LIMIT 1) SELECT Fact_Age_18_24 FROM Base"
}
]
}
},
{
"id": 500017,
"name": "Fact_Age_25_44",
"threshold": 50,
"ml_model": {
"name": "Fact_Age_25_44",
"version": "1.0.0",
"calculationIntervalInSeconds": 15,
"isActive": true,
"url": "https://configuration.atom.ai.verve.com/api/v3/atom/model?bundleId=de.tvsmiles.app&model=Fact_Age_25_44_1.0.0.tflite&apiKey=ml_v8",
"providers": [
{
"statement": "WITH base as (SELECT CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Frau / Sie', 'Mrs / She') then 1 else 0 end as Fact_Female, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Herr / Er', 'Mr / He') then 1 else 0 end as Fact_Male, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '18-24' then 1 else 0 end as Fact_Age_18_24, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '25-44' then 1 else 0 end as Fact_Age_25_44, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '45+' then 1 else 0 end as Fact_Age_45p FROM vrv_atom_adSessionData WHERE ad_session_data like \"%SurveyData%\" ORDER BY ROWID DESC LIMIT 1) SELECT Fact_Age_25_44 FROM Base"
}
]
}
},
{
"id": 500018,
"name": "Fact_Age_45p",
"threshold": 50,
"ml_model": {
"name": "Fact_Age_45p",
"version": "1.0.0",
"calculationIntervalInSeconds": 15,
"isActive": true,
"url": "https://configuration.atom.ai.verve.com/api/v3/atom/model?bundleId=de.tvsmiles.app&model=Fact_Age_45p_1.0.0.tflite&apiKey=ml_v8",
"providers": [
{
"statement": "WITH base as (SELECT CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Frau / Sie', 'Mrs / She') then 1 else 0 end as Fact_Female, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Herr / Er', 'Mr / He') then 1 else 0 end as Fact_Male, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '18-24' then 1 else 0 end as Fact_Age_18_24, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '25-44' then 1 else 0 end as Fact_Age_25_44, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '45+' then 1 else 0 end as Fact_Age_45p FROM vrv_atom_adSessionData WHERE ad_session_data like \"%SurveyData%\" ORDER BY ROWID DESC LIMIT 1) SELECT Fact_Age_45p FROM Base"
}
]
}
},
{
"id": 500015,
"name": "Fact_Female",
"threshold": 50,
"ml_model": {
"name": "Fact_Female",
"version": "1.0.0",
"calculationIntervalInSeconds": 15,
"isActive": true,
"url": "https://configuration.atom.ai.verve.com/api/v3/atom/model?bundleId=de.tvsmiles.app&model=Fact_Female_1.0.0.tflite&apiKey=ml_v8",
"providers": [
{
"statement": "WITH base as (SELECT CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Frau / Sie', 'Mrs / She') then 1 else 0 end as Fact_Female, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Herr / Er', 'Mr / He') then 1 else 0 end as Fact_Male, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '18-24' then 1 else 0 end as Fact_Age_18_24, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '25-44' then 1 else 0 end as Fact_Age_25_44, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '45+' then 1 else 0 end as Fact_Age_45p FROM vrv_atom_adSessionData WHERE ad_session_data like \"%SurveyData%\" ORDER BY ROWID DESC LIMIT 1) SELECT Fact_Female FROM Base"
}
]
}
},
{
"id": 500014,
"name": "Fact_Male",
"threshold": 50,
"ml_model": {
"name": "Fact_Male",
"version": "1.0.0",
"calculationIntervalInSeconds": 15,
"isActive": true,
"url": "https://configuration.atom.ai.verve.com/api/v3/atom/model?bundleId=de.tvsmiles.app&model=Fact_Male_1.0.0.tflite&apiKey=ml_v8",
"providers": [
{
"statement": "WITH base as (SELECT CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Frau / Sie', 'Mrs / She') then 1 else 0 end as Fact_Female, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'salutation')+13), 1000) ,'\"')-1), '-') in ('Herr / Er', 'Mr / He') then 1 else 0 end as Fact_Male, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '18-24' then 1 else 0 end as Fact_Age_18_24, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '25-44' then 1 else 0 end as Fact_Age_25_44, CASE WHEN IFNULL(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'age')+6), 1000) ,'\"')-1), '-') = '45+' then 1 else 0 end as Fact_Age_45p FROM vrv_atom_adSessionData WHERE ad_session_data like \"%SurveyData%\" ORDER BY ROWID DESC LIMIT 1) SELECT Fact_Male FROM Base"
}
]
}
},
{
"id": 200015,
"name": "Female",
"threshold": "0.1",
"ml_model": {
"name": "Female",
"version": "1.0.0",
"calculationIntervalInSeconds": 15,
"isActive": true,
"url": "https://configuration.atom.ai.verve.com/api/v3/atom/model?bundleId=de.tvsmiles.app&model=Female_1.0.0.tflite&apiKey=ml_v8",
"providers": [
{
"statement": "WITH ad_engagement as ( SELECT sum(app_lovin_video_impressions) as app_lovin_video_impressions, sum(app_lovin_video_start) as app_lovin_video_start, sum(app_lovin_video_dismiss) as app_lovin_video_dismiss, sum(app_lovin_video_finish) as app_lovin_video_finish, sum(app_lovin_ad_clicked) as app_lovin_ad_clicked, sum(app_lovin_ads) as app_lovin_ads, sum(app_lovin_ads)*1.0/count(*) as app_lovin_ads_pc, sum(app_lovin_ad_clicked)*1.0/sum(app_lovin_ads) as ad_clicked_pc, avg(app_lovin_ctr) as avg_app_lovin_ctr, avg(app_lovin_eCPM) as avg_app_lovin_eCPM, avg(app_lovin_rCPM) as avg_app_lovin_rCPM, sum(Hybid_ads) as Hybid_ads, avg(hybid_viewability) as avg_hybid_viewability, avg(hybid_bid_price) as avg_hybid_bid_price, sum(Hybid_ads)*1.0/count(*) as Hybid_ads_pc FROM (SELECT case when ad_session_data like \"%campaign tile index%\" then (case when ad_session_data like '%\"Video Impression\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"Video Impression\"')+19), 1) as int) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'Video Impression')+17), 1) as int) end) else NULL end as app_lovin_video_impressions, case when ad_session_data like \"%campaign tile index%\" then (case when ad_session_data like '%\"Video Start\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"Video Start\"')+14), 1) as int) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'Video Start')+12), 1) as int) end) else NULL end as app_lovin_video_start, case when ad_session_data like \"%campaign tile index%\" then (case when ad_session_data like '%\"Video Dismiss\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"Video Dismiss\"')+16), 1) as int) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'Video Dismiss')+14), 1) as int) end) else NULL end as app_lovin_video_dismiss, case when ad_session_data like \"%campaign tile index%\" then (case when ad_session_data like '%\"Video Finish\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"Video Finish\"')+15), 1) as int) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'Video Finish')+13), 1) as int) end) else NULL end as app_lovin_video_finish, case when ad_session_data like \"%campaign tile index%\" then (case when ad_session_data like '%\"ad clicked\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"ad clicked\"')+13), 1) as int) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'ad clicked')+11), 1) as int) end) else NULL end as app_lovin_ad_clicked, case when ad_session_data like \"%campaign tile index%\" then (case when ad_session_data like '%\"ctr\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"ctr\"')+6), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"ctr\"')+6), 1000) ,'}')-1) as float) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'ctr')+4), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'ctr')+4), 1000) ,',')-1) as float) end) else NULL end as app_lovin_ctr, case when ad_session_data like \"%campaign tile index%\" then (case when ad_session_data like '%\"eCPM\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"eCPM\"')+7), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"eCPM\"')+7), 1000) ,'}')-1) as float) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'eCPM')+5), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'eCPM')+5), 1000) ,',')-1) as float) end) else NULL end as app_lovin_eCPM, case when ad_session_data like \"%campaign tile index%\" then (case when ad_session_data like '%\"rCPM\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"rCPM\"')+7), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"rCPM\"')+7), 1000) ,'}')-1) as float) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'rCPM')+5), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'rCPM')+5), 1000) ,',')-1) as float) end) else NULL end as app_lovin_rCPM, case when ad_session_data like \"%campaign tile index%\" then 1 else 0 end as app_lovin_ads, case when ad_session_data like \"%Rendering_status%\" then 1 else 0 end as hybid_ads, case when ad_session_data like \"%Rendering_status%\" then (case when ad_session_data like '%\"Viewability\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"Viewability\"')+14), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"Viewability\"')+14), 1000) ,'}')-1) as float) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'Viewability')+12), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'Viewability')+12), 1000) ,',')-1) as float) end) else NULL end as hybid_viewability, case when ad_session_data like \"%Rendering_status%\" then (case when ad_session_data like '%\"Bid price\"%' then cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"Bid price\"')+13), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, '\"Bid price\"')+13), 1000) ,'\"')-1) as float) else cast(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'Bid price')+12), INSTR(SUBSTR(ad_session_data, (INSTR(ad_session_data, 'Bid price')+12), 1000) ,'}')-1) as float) end) else NULL end as hybid_bid_price FROM (select distinct ad_session_data FROM vrv_atom_adSessionData) A) B), connection_type as ( Select sum(samples) as total_samples, sum(case when connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_pc, sum(case when DoW=0 then samples else 0 end)*1.0/sum(samples) as DOW_0_pc, sum(case when DoW=1 then samples else 0 end)*1.0/sum(samples) as DOW_1_pc, sum(case when DoW=2 then samples else 0 end)*1.0/sum(samples) as DOW_2_pc, sum(case when DoW=3 then samples else 0 end)*1.0/sum(samples) as DOW_3_pc, sum(case when DoW=4 then samples else 0 end)*1.0/sum(samples) as DOW_4_pc, sum(case when DoW=5 then samples else 0 end)*1.0/sum(samples) as DOW_5_pc, sum(case when DoW=6 then samples else 0 end)*1.0/sum(samples) as DOW_6_pc, sum(case when DoW not in (0,6) then samples else 0 end)*1.0/sum(samples) as DOW_wk_pc, sum(case when DoW in (0,6) then samples else 0 end)*1.0/sum(samples) as DOW_wkend_pc, sum(case when DoW=0 and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_0_pc, sum(case when DoW=1 and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_1_pc, sum(case when DoW=2 and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_2_pc, sum(case when DoW=3 and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_3_pc, sum(case when DoW=4 and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_4_pc, sum(case when DoW=5 and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_5_pc, sum(case when DoW=6 and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_6_pc, sum(case when DoW not in (0,6) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_wk_pc, sum(case when DoW in (0,6) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_DOW_wkend_pc, sum(case when DoW=0 and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW=0 then samples else 0 end) as wifi_dow_DOW_0_pc, sum(case when DoW=1 and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW=1 then samples else 0 end) as wifi_dow_DOW_1_pc, sum(case when DoW=2 and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW=2 then samples else 0 end) as wifi_dow_DOW_2_pc, sum(case when DoW=3 and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW=3 then samples else 0 end) as wifi_dow_DOW_3_pc, sum(case when DoW=4 and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW=4 then samples else 0 end) as wifi_dow_DOW_4_pc, sum(case when DoW=5 and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW=5 then samples else 0 end) as wifi_dow_DOW_5_pc, sum(case when DoW=6 and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW=6 then samples else 0 end) as wifi_dow_DOW_6_pc, sum(case when DoW not in (0,6) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW not in (0,6) then samples else 0 end) as wifi_dow_DOW_wk_pc, sum(case when DoW in (0,6) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when DoW in (0,6) then samples else 0 end) as wifi_dow_DOW_wkend_pc, sum(case when ToD in (0,23) then samples else 0 end)*1.0/sum(samples) as ToD_0_23_pc, sum(case when ToD in (20,22) then samples else 0 end)*1.0/sum(samples) as ToD_20_22_pc, sum(case when ToD in (19) then samples else 0 end)*1.0/sum(samples) as ToD_19_pc, sum(case when ToD in (14,15,16,17,18) then samples else 0 end)*1.0/sum(samples) as ToD_14_18_pc, sum(case when ToD in (12,13) then samples else 0 end)*1.0/sum(samples) as ToD_12_13_pc, sum(case when ToD in (9,10,11) then samples else 0 end)*1.0/sum(samples) as ToD_9_11_pc, sum(case when ToD in (1,2,3,4,5,6,7,8) then samples else 0 end)*1.0/sum(samples) as ToD_1_8_pc, sum(case when ToD in (0,23) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_ToD_0_23_pc, sum(case when ToD in (20,22) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_ToD_20_22_pc, sum(case when ToD in (19) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_ToD_19_pc, sum(case when ToD in (14,15,16,17,18) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_ToD_14_18_pc, sum(case when ToD in (12,13) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_ToD_12_13_pc, sum(case when ToD in (9,10,11) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_ToD_9_11_pc, sum(case when ToD in (1,2,3,4,5,6,7,8) and connection_type='WIFI' then samples else 0 end)*1.0/sum(samples) as wifi_ToD_1_8_pc, sum(case when ToD in (0,23) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when ToD in (0,23) then samples else 0 end) as wifi_tod_ToD_0_23_pc, sum(case when ToD in (20,22) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when ToD in (20,22) then samples else 0 end) as wifi_tod_ToD_20_22_pc, sum(case when ToD in (19) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when ToD in (19) then samples else 0 end) as wifi_tod_ToD_19_pc, sum(case when ToD in (14,15,16,17,18) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when ToD in (14,15,16,17,18) then samples else 0 end) as wifi_tod_ToD_14_18_pc, sum(case when ToD in (12,13) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when ToD in (12,13) then samples else 0 end) as wifi_tod_ToD_12_13_pc, sum(case when ToD in (9,10,11) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when ToD in (9,10,11) then samples else 0 end) as wifi_tod_ToD_9_11_pc, sum(case when ToD in (1,2,3,4,5,6,7,8) and connection_type='WIFI' then samples else 0 end)*1.0/sum(case when ToD in (1,2,3,4,5,6,7,8) then samples else 0 end) as wifi_tod_ToD_1_8_pc from (select connection_type, cast(strftime('%H', DATETIME(A.time_stamp/1000, 'unixepoch')) as INT) as ToD, cast(strftime('%w', DATETIME(A.time_stamp/1000, 'unixepoch')) as INT) as DoW, count(*) as samples from vrv_atom_device_signals A where A.time_stamp!='' GROUP BY 1,2,3) A), screen_brightness as ( Select avg(screen_brightness) as avg_sb, ifnull(avg(case when DoW=0 then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_0_pc, ifnull(avg(case when DoW=1 then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_1_pc, ifnull(avg(case when DoW=2 then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_2_pc, ifnull(avg(case when DoW=3 then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_3_pc, ifnull(avg(case when DoW=4 then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_4_pc, ifnull(avg(case when DoW=5 then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_5_pc, ifnull(avg(case when DoW=6 then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_6_pc, ifnull(avg(case when DoW not in (0,6) then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_wk_pc, ifnull(avg(case when DoW in (0,6) then screen_brightness else NULL end), avg(screen_brightness)) as sb_DOW_wkend_pc, ifnull(avg(case when ToD in (0,23) then screen_brightness else NULL end), avg(screen_brightness)) as sb_ToD_0_23_pc, ifnull(avg(case when ToD in (20,22) then screen_brightness else NULL end), avg(screen_brightness)) as sb_ToD_20_22_pc, ifnull(avg(case when ToD in (19) then screen_brightness else NULL end), avg(screen_brightness)) as sb_ToD_19_pc, ifnull(avg(case when ToD in (14,15,16,17,18) then screen_brightness else NULL end), avg(screen_brightness)) as sb_ToD_14_18_pc, ifnull(avg(case when ToD in (12,13) then screen_brightness else NULL end), avg(screen_brightness)) as sb_ToD_12_13_pc, ifnull(avg(case when ToD in (9,10,11) then screen_brightness else NULL end), avg(screen_brightness)) as sb_ToD_9_11_pc, ifnull(avg(case when ToD in (1,2,3,4,5,6,7,8) then screen_brightness else NULL end), avg(screen_brightness)) as sb_ToD_1_8_pc FROM (select A.screen_brightness*0.01 as screen_brightness, cast(strftime('%H', DATETIME(A.time_stamp/1000, 'unixepoch')) as int) as ToD, cast(strftime('%w', DATETIME(A.time_stamp/1000, 'unixepoch')) as int) as DoW from vrv_atom_device_signals A where A.time_stamp!='') A), battery as (Select avg(battery_level) as avg_bl, ifnull(avg(case when DoW=0 then battery_level else NULL end), avg(battery_level)) as bl_DOW_0_pc, ifnull(avg(case when DoW=1 then battery_level else NULL end), avg(battery_level)) as bl_DOW_1_pc, ifnull(avg(case when DoW=2 then battery_level else NULL end), avg(battery_level)) as bl_DOW_2_pc, ifnull(avg(case when DoW=3 then battery_level else NULL end), avg(battery_level)) as bl_DOW_3_pc, ifnull(avg(case when DoW=4 then battery_level else NULL end), avg(battery_level)) as bl_DOW_4_pc, ifnull(avg(case when DoW=5 then battery_level else NULL end), avg(battery_level)) as bl_DOW_5_pc, ifnull(avg(case when DoW=6 then battery_level else NULL end), avg(battery_level)) as bl_DOW_6_pc, ifnull(avg(case when DoW not in (0,6) then battery_level else NULL end), avg(battery_level)) as bl_DOW_wk_pc, ifnull(avg(case when DoW in (0,6) then battery_level else NULL end), avg(battery_level)) as bl_DOW_wkend_pc, ifnull(avg(case when ToD in (0,23) then battery_level else NULL end), avg(battery_level)) as bl_ToD_0_23_pc, ifnull(avg(case when ToD in (20,22) then battery_level else NULL end), avg(battery_level)) as bl_ToD_20_22_pc, ifnull(avg(case when ToD in (19) then battery_level else NULL end), avg(battery_level)) as bl_ToD_19_pc, ifnull(avg(case when ToD in (14,15,16,17,18) then battery_level else NULL end), avg(battery_level)) as bl_ToD_14_18_pc, ifnull(avg(case when ToD in (12,13) then battery_level else NULL end), avg(battery_level)) as bl_ToD_12_13_pc, ifnull(avg(case when ToD in (9,10,11) then battery_level else NULL end), avg(battery_level)) as bl_ToD_9_11_pc, ifnull(avg(case when ToD in (1,2,3,4,5,6,7,8) then battery_level else NULL end), avg(battery_level)) as bl_ToD_1_8_pc FROM (select A.battery_level *0.01 as battery_level, cast(strftime('%H', DATETIME(A.time_stamp/1000, 'unixepoch')) as int) as ToD, cast(strftime('%w', DATETIME(A.time_stamp/1000, 'unixepoch')) as int) as DoW from vrv_atom_device_signals A where A.time_stamp!='') A), all_data as (select ad_engagement.*, connection_type.*, screen_brightness.*, battery.* from battery join screen_brightness join connection_type left join ad_engagement ON 1=1) SELECT IFNULL((avg_hybid_viewability - 0.666) / 0.214, 0.666) as avg_hybid_viewability, IFNULL((avg_hybid_bid_price - 28.778) / 38.313, 28.778) as avg_hybid_bid_price, IFNULL((Hybid_ads_pc - 0.043) / 0.081, 0.043) as Hybid_ads_pc, IFNULL((wifi_pc - 0.922) / 0.125, 0.922) as wifi_pc, IFNULL((DOW_0_pc - 0.138) / 0.128, 0.138) as DOW_0_pc, IFNULL((DOW_1_pc - 0.114) / 0.137, 0.114) as DOW_1_pc, IFNULL((DOW_2_pc - 0.126) / 0.126, 0.126) as DOW_2_pc, IFNULL((DOW_3_pc - 0.118) / 0.110, 0.118) as DOW_3_pc, IFNULL((DOW_4_pc - 0.164) / 0.125, 0.164) as DOW_4_pc, IFNULL((DOW_5_pc - 0.165) / 0.138, 0.165) as DOW_5_pc, IFNULL((DOW_6_pc - 0.174) / 0.156, 0.174) as DOW_6_pc, IFNULL((DOW_wk_pc - 0.687) / 0.201, 0.687) as DOW_wk_pc, IFNULL((DOW_wkend_pc - 0.312) / 0.200, 0.312) as DOW_wkend_pc, IFNULL((wifi_DOW_0_pc - 0.132) / 0.123, 0.132) as wifi_DOW_0_pc, IFNULL((wifi_DOW_1_pc - 0.106) / 0.133, 0.106) as wifi_DOW_1_pc, IFNULL((wifi_DOW_2_pc - 0.118) / 0.123, 0.118) as wifi_DOW_2_pc, IFNULL((wifi_DOW_3_pc - 0.100) / 0.103, 0.100) as wifi_DOW_3_pc, IFNULL((wifi_DOW_4_pc - 0.153) / 0.119, 0.153) as wifi_DOW_4_pc, IFNULL((wifi_DOW_5_pc - 0.156) / 0.137, 0.156) as wifi_DOW_5_pc, IFNULL((wifi_DOW_6_pc - 0.157) / 0.156, 0.157) as wifi_DOW_6_pc, IFNULL((wifi_DOW_wk_pc - 0.634) / 0.205, 0.634) as wifi_DOW_wk_pc, IFNULL((wifi_DOW_wkend_pc - 0.289) / 0.201, 0.289) as wifi_DOW_wkend_pc, IFNULL((wifi_dow_DOW_0_pc - 0.823) / 0.353, 0.823) as wifi_dow_DOW_0_pc, IFNULL((wifi_dow_DOW_1_pc - 0.772) / 0.370, 0.772) as wifi_dow_DOW_1_pc, IFNULL((wifi_dow_DOW_2_pc - 0.735) / 0.398, 0.735) as wifi_dow_DOW_2_pc, IFNULL((wifi_dow_DOW_3_pc - 0.682) / 0.370, 0.682) as wifi_dow_DOW_3_pc, IFNULL((wifi_dow_DOW_4_pc - 0.797) / 0.348, 0.797) as wifi_dow_DOW_4_pc, IFNULL((wifi_dow_DOW_5_pc - 0.836) / 0.327, 0.836) as wifi_dow_DOW_5_pc, IFNULL((wifi_dow_DOW_6_pc - 0.780) / 0.330, 0.780) as wifi_dow_DOW_6_pc, IFNULL((wifi_dow_DOW_wk_pc - 0.901) / 0.191, 0.901) as wifi_dow_DOW_wk_pc FROM all_data"
}
]
}
}
],
"flush": [
{
"query": "INSERT INTO vrv_atom_adSessionData VALUES ('{SurveyData:[{"form_id":"v1","salutation":"Frau / Sie","age":"45+"}]}')",
"repetitionIntervalInSeconds": 86400
},
{
"query": "DROP TABLE IF EXISTS vrv_atom_signal_battery",
"repetitionIntervalInSeconds": 86400
},
{
"query": "DROP TABLE IF EXISTS vrv_atom_signal_reachability",
"repetitionIntervalInSeconds": 86400
},
{
"query": "DROP TABLE IF EXISTS vrv_atom_signal_luminosity",
"repetitionIntervalInSeconds": 86400
}
],
"refreshRateInSeconds": 30,
"mlCohortsCalculationDelayInMilliseconds": 2000,
"enableGyroscopeDataCollection": true,
"enableAccelerometerDataCollection": true,
"accelerometerGyroscopeFrequency": 5,
"accelerometerGyroscopeMaxLimit": 3000,
"accelerometerGyroscopeBatchSize": 100,
"accelerometerGyroscopeMaxBatchLimitMs": 60000,
"archiveLocalDbs": {
"shouldArchive": true,
"samplingRate": 1.0,
"uploadFrequency": {
"days": ">0",
"startupCount": ">0"
}
},
"enableGestureCollection": true,
"sendHistoryOnStart": true,
"shouldStart": true,
"date": "1747802871",
"version": "3.6.0",
"appClassification": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment