snowplow / enrich

Snowplow Enrichment jobs and library
https://snowplowanalytics.com
Other
21 stars 39 forks source link

Add Cross Navigation Enrichment #821

Closed adatzer closed 9 months ago

adatzer commented 1 year ago

This pull request adds an enrichment that can parse the extended cross navigation format in _sp querystring parameter and attach the cross_navigation context to an event.

The extended cross navigation format can be described by _sp={domainUserId}.{timestamp}.{sessionId}.{subjectUserId}.{sourceId}.{platform}.{reason}

The changes in the trackers to allow this extended format can be seen in:

The corresponding iglu-central pull requests are:

cc @greg-el @igneel64 @matus-tomlein

matus-tomlein commented 1 year ago

Edit: Have tested this implementation both with the mobile and JS trackers, it works nicely, great work!

adatzer commented 1 year ago

Hi Enes! Thank you very much for reviewing and for creating the cleanup branch. This was really helpful! I have cherry-picked your commit as is, and also applied scalafmt.

The additional Make edits commit includes some edits related to:

  1. The cross-navigation schema (pending final review). Since the timestamp and the domain_user_id props are required, we decided that if they are missing, the enrichment should not add the corresponding entity at all, i.e. this is considered invalid extended format.
  2. As discussed with Analytics Engineers it is a bit preferrable for optional properties to be null (which is valid according to schema), rather than missing. This is why the filterNot was removed.
  3. Corresponding test changes related to the above.

Additionally, this PR has 2 iglu-central pull requests as dependencies:

Please let us know what you think of these last changes and whether there is anything else to be done from our side. Thanks once again!

cc @igneel64 @greg-el @matus-tomlein

spenes commented 9 months ago

Moved to https://github.com/snowplow/enrich/pull/856, closing this one.