Persistent domain_sessionid in native mobile app and webview

We have been using snowplow tracker for native mobile applications. Native app doesn’t have built-in screens for all possible URLs, so the app opens some content in web view.

Web view creates it’s own session and it has different domain_sessionid each time.

Is there anyway we can inherit domain_sessionid for web view from native app session?

What sort of analysis are you looking to do?

I ask because domain_sessionid and the mobile session identifier aren’t compatible - so in use case like this typically what you would do is pass the client_session to the webview and then attach that as a context to the web event.

Thank you @mike for your response.

We have been using TealiumIQ for our tag management and snowplow is being managed by TealiumIQ.

TealiumIQ initialises snowplow in a hidden native webview, that way all our events from both web and mobile can use same Iglu schema. The point here is, our data structures are same across web and native mobile app and we have domain_sessionid for mobile.

Now the application itself opens a range of URLs in webview and those webviews have different session id as compared to the events coming from native app.

I guess we can read the session id from the TealiumIQ managed hidded webview for snowplow and pass it to the app managed webview as a query param in the URL, but is there any way we can set/override a custom session id coming as a query param?

Sorry for coming with more questions.
It’s not clear to me the relation between the TealiumIQ managed webview and the app’s webviews.

What you say makes me think that the app’s webviews have their own local Snowplow web tracker and you would like to pass the sessionID from Tealium’s webview to the app’s webview. In that case I would follow the mike’s suggestion. You could pass the app sessionID to your app’s webview in that way the webviews events and the apps would have the same sessionID.

You could use Global Contexts feature of the web tracker to create a custom entity added to all the events tracked by the web tracker where you put the app’s sessionID. In the data modelling you would be able to collect all the webview’s and app’s events with a join on that custom entity.

Let me know if I misunderstood your setup.

1 Like

Thanks @Alex_Benini for your response. And sorry for my late reply.

Your understanding is completely correct.

Normally the webapp generates the _sp_id.xxxx cookie with an auto-generated session id. I was wondering if there is any built-in method in snowplow library to override that with the one coming from native app, I couldn’t find one.

I guess you are suggesting to leave domain_sessionid as is, instead use a custom entity in global context and collect the session id as if we are collecting a context info. I agree that this would be a feasible workaround.

Regards,
Khalid

Unfortunately, there aren’t simple ways to overwrite the domain_sessionid.
I think the best workaround is to create a custom context with the sessionId from the mobile tracker.

Out of curiosity, which version of the mobile tracker do you use?