Tracking web events into Native app

Currently we are using the JS tracker and setup the Google Tag manager and able to transfer the web events into existing native app pipeline into collector. Now wants to track my web event into my native app(android & iOS) session. Currently I can see the user_id, user_ipaddress are the only 2 sources which are supporting for both web and native app but still not giving assurity that from which session the user moved to web as user might using public ip or using multiple time web in different session but as we don’t have information about session_id in JS tracker that from which session he has open the web event its difficult to track.

Is there any existing filed or enrichment we can do for capturing session_id to track web event into native app or any option through which we can send the session information of web to native collector.

Hi Team,

Any help on above query?

Hi @sachin,

If I understand correctly, you want to pass the session identifier when the user transitions from a Web app to a mobile app or vice versa. Is that correct?

The user and session identifiers within each app will be unique (Web app will have different user and session than a mobile app on the same device).

But you can pass the user and session identifiers in links between the apps. This feature is called cross domain tracking, here is the documentation for the JS tracker and here is the same option for decorating links on the mobile trackers.

The idea there is that each outgoing link from an app with be added an ?sp= GET parameter containing dot separated identifiers. On the JS tracker, you can choose which identifiers to include as follows (sorry this is missing from the docs, will update):

  tracker = newTracker("ns1", endpoint, {
    useExtendedCrossDomainLinker: {
      userId: true,
      sessionId: true,
      sourceId: false,
      sourcePlatform: false
    },
    crossDomainLinker: () => true,
});

Does that help or did you want to achieve something else?