Skip to content

Commit

Permalink
Add processUserId callback docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Jul 11, 2023
1 parent 16d55af commit 7c8b7ca
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,42 @@ Session context needs to be enabled (default) in order for the integration to wo
:::note
The feature is available since version 5.3 of the iOS and Android trackers.
:::

## Processing the user ID sent in requests to Kantar

By default, the plugin sends the user ID as a GET parameter in requests to Kantar without modifying it.
In case you want to apply some transformation on the value, such as hashing, you can provide the `processUserId` callback when instantiating the plugin:

<Tabs groupId="platform">
<TabItem value="ios" label="iOS" default>

```swift
let focalMeterConfig = FocalMeterConfiguration(kantarEndpoint: "https://thekantarendpoint.com") { userId in
return hash(userId) // apply custom hashing function
}
let tracker = Snowplow.createTracker(namespace: namespace, network: networkConfig, configurations: [focalMeterConfig])
```

</TabItem>
<TabItem value="android" label="Android (Kotlin)">

```kotlin
val focalMeterConfig = FocalMeterConfiguration("https://thekantarendpoint.com") { userId ->
hash(userId) // apply custom hashing function
}
val tracker = Snowplow.createTracker(applicationContext, namespace, networkConfiguration, focalMeterConfig)
```

</TabItem>
<TabItem value="android-java" label="Android (Java)">

```java
FocalMeterConfiguration focalMeterConfig = new FocalMeterConfiguration(
"https://thekantarendpoint.com",
userId -> hash(userId) // apply custom hashing function
);
Snowplow.createTracker(applicationContext, namespace, networkConfiguration, focalMeterConfig);
```

</TabItem>
</Tabs>

0 comments on commit 7c8b7ca

Please sign in to comment.