Skip to content

Commit 6092e2c

Browse files
committed
docs: added example of track() invocation
Signed-off-by: Nicklas Lundin <[email protected]>
1 parent 658455e commit 6092e2c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@ This is essential for robust experimentation powered by feature flags. Note that
126126
that handle feature flag evaluations, calling `track(...)` may throw an `IllegalArgumentException`
127127
if an empty string is passed as the `trackingEventName`.
128128

129+
Below is an example of how we can track a "Checkout" event with some `TrackingDetails`.
130+
131+
```kotlin
132+
OpenFeatureAPI.getClient().track(
133+
"Checkout",
134+
TrackingEventDetails(
135+
499.99,
136+
ImmutableStructure(
137+
"numberOfItems" to Value.Integer(4),
138+
"timeInCheckout" to Value.String("PT3M20S")
139+
)
140+
)
141+
)
142+
```
143+
129144
Tracking is optionally implemented by Providers.
130145

131146

0 commit comments

Comments
 (0)