Skip to main content

Anonymous Tracking

info

This feature is available since v1.3.

note

Version 4 of the React Native tracker does not yet provide full support for client-side anonymization, but this is something we plan to introduce in the upcoming versions.

Anonymous tracking is a tracker feature that enables anonymizing various user and session identifiers to support user privacy in case consent for tracking the identifiers is not given.

On mobile, the following user and session identifiers can be anonymized:

  • Client-side user identifiers:
    • userId in the Session context entity
    • IDFA identifiers (appleIdfa and appleIdfv for iOS, androidIdfa for Android) in the Platform context entity
    • userId, domainUserId, networkUserId, ipAddress if they are set in Subject
  • Client-side session identifiers: sessionId and previousSessionId in Session entity.
  • Server-side user identifiers: network_userid and user_ipaddress event properties.

There are several levels to the anonymization depending on which of the three categories are affected:

1. Full client-side anonymization

In this case, we want to anonymise both the client-side user identifiers as well as the client-side session identifiers. This means disabling the Session context altogether and enabling user anonymization:

const tracker = await newTracker({
namespace: 'appTracker',
endpoint: COLLECTOR_URL,
sessionContext: false, // Session context entity won't be added to events
});
Subject and platform context properties not anonymised

The version 4 does not yet automatically anonymise the userId in the Subject and the IDFA and other identifiers in the platform context entity. These need to be removed manually.

2. Client-side anonymization with session tracking

This setting disables client-side user identifiers but tracks session information. In practice, this means that events track the Session context entity but the userId property is a null UUID (00000000-0000-0000-0000-000000000000). In case Platform context is enabled, the IDFA identifiers will not be present.

Not yet available

This option is not yet available in the version 4 of the React Native tracker.

3. Server-side anonymization

Server-side anonymization affects user identifiers set server-side. In particular, these are the network_userid property set in server-side cookie and the user IP address. You can anonymise the properties using the serverAnonymisation flag in EmitterConfiguration:

const tracker = await newTracker(
namespace: 'appTracker',
endpoint: COLLECTOR_URL,
serverAnonymization: true,
});

Setting the flag will add a SP-Anonymous HTTP header to requests sent to the Snowplow collector. The Snowplow pipeline will take care of anonymising the identifiers.