Is your question for iOS or Android? There is a slight difference between them. And to answer your questions:
It seems like we need to inlcude this code to every hit, right? Plus if we need more infos we are able to use context data within the lifecycle code.
No. You shouldn’t include this code to every hit. You should just follow the docs and put the code to where it is required.
is there a good reason for using context data in life cycle metrics.
You can track any data you want with the lifecycle hit
You can use them as the Traits for In-app message
Plus am I able to include pages in there (standard dimension)
No. You won’t be able to track page name with Lifecycle hit. For lifecycle hit, we use ‘pe=lnk_o’, so the backend server won’t collect page name on this call.
So in the scenario you mentioned, you won’t be able to put ‘page b’ info into the lifecycle hit.
Would the value in the life cycle been only triggered when a launchevent gets triggered or on every hit where we can adjust the value?
The additional context data you passed in will only be sent with the lifecycle analytics hit, it won’t included on every hit.
an launch event only occures when a user comes the very first time or when 5 min inactivity occured, right?
Correct. By default it is 5 min but you can change that.
does a launch alwys insists a launch?
I’m not sure what you mean. Can you please clarify.
plus what if I use backdate session to which order would the crash in my example go to?
‘backdate session’ only helps to contribute the session length or crash to the correct date/time. For example when it is not enable, you opened the app yesterday and it crashed, then you open it today, now the crash will be tracked to today. But if you enable it, it can be correctly back tracked to yesterday.
Let us know if you have further questions. Thanks.