snowplow / snowplow-android-tracker

Snowplow event tracker for Android. Add analytics to your Android apps and games
http://snowplowanalytics.com
Apache License 2.0
110 stars 63 forks source link

Add DeepLink entity referrer and url to atomic properties in ScreenView events (close #553) #554

Closed matus-tomlein closed 2 years ago

matus-tomlein commented 2 years ago

Issue #553

This PR extends the workaround in the tracker which sets the page referrer and page URL atomic properties in events – previously it only set them for deep link events based on their properties. Now, it also sets them for screen view events based on the deep link context entities.

I had to move the workaround to a different place. Previously it was called in addSelfDescribingPropertiesToPayload() in Tracker but at that point the events do not contain context entities assigned using state machines. Since the deep link entity is added in a state machine, I moved the call to after state machine context entities are added to events.

Documentation: Tracking Events > Deep Link

The tracked DeepLinkReceived event and each subsequent ScreenView event also have the URL and referrer information added in the page_url and page_referrer atomic properties in the events. This makes them compatible with data models built for events tracked on the Web.