Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!
SOLVED

Data Insertion API and Mobile Lifecyle Metrics

Avatar

Level 2

Hello All,

I am seeking a best practice for implementing the lifecycle metrics using the API insertion route for apps.

Is there a document or example code that someone could share regarding the setup?

I know with the SDKs you basically just set the below for Install/Launch

{

"lifecyclecontextdata": {

"installdate": "22/05/2014",

"hourofday": 6,

"dayofweek": 2,

"osversion": "iOS 12.3",

"appID": "contextDataValue",

"resolution": "600x1345",

"devicename": "iPhoneX",

"launchevent": "LaunchEvent",

"prevsessionlength": 345,

"locale": "en-US",

"runmode": "Application",

"launches": 42

},

"starttimestampmillis": 44,

"maxsessionlength": 22,

{

"lifecyclecontextdata": {

"installevent": "InstallEvent",

"dailyenguserevent": "DailyEngUserEvent",

"monthlyenguserevent": "MonthlyEngUserEvent",

"installdate": "22/05/2014"...

},

}

{

"lifecyclecontextdata": {

"launchevent": "LaunchEvent",

"dailyenguserevent": "DailyEngUserEvent",

"monthlyenguserevent": "MonthlyEngUserEvent",

"installdate": "22/05/2014",

"launches": 42,

"dayssincelastuse": 4,

"dayssincefirstuse": 28...

},

}

Is there something equivalent that I can use for the API route?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 2

Side note, I was given this response previously,

If..."You want to use code to manually increase the Launches metric (and I think that's what you mean). then you'll want to set this context data variable:

s.contextData['a.LaunchEvent'] = '1';

(that's using JavaScript, obviously)"

I am looking for the equivalent for the API equivalent

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

Side note, I was given this response previously,

If..."You want to use code to manually increase the Launches metric (and I think that's what you mean). then you'll want to set this context data variable:

s.contextData['a.LaunchEvent'] = '1';

(that's using JavaScript, obviously)"

I am looking for the equivalent for the API equivalent