You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,33 @@ MainActivity.OPTABLE!!
134
134
135
135
On success, the resulting key values are typically sent as part of a subsequent ad call. Therefore we recommend that you either call `targeting()` before each ad call, or in parallel periodically, caching the resulting key values which you then provide in ad calls.
136
136
137
+
### Witness API
138
+
139
+
To send real-time event data from the user's device to the sandbox for eventual audience assembly, you can call the witness API as follows:
.witness("example.event.type", hashMapOf("example" to "value"))
149
+
.observe(viewLifecycleOwner, Observer { result ->
150
+
if (result.status ==OptableSDK.Status.SUCCESS) {
151
+
Log.i("Witness API Success... ")
152
+
} else {
153
+
// result.status is OptableSDK.Status.ERROR
154
+
// result.message is the error message
155
+
Log.e("Witness API Error: ${result.message}")
156
+
}
157
+
})
158
+
```
159
+
160
+
The specified event type and properties are associated with the logged event and which can be used for matching during audience assembly.
161
+
162
+
Note that event properties are of type `OptableWitnessProperties` which is an alias for `HashMap<String,String>`, and should consist only of string keyvalue pairs.
163
+
137
164
### Integrating GAM360
138
165
139
166
We can further extend the above `targeting` example to show an integration with a [Google Ad Manager 360](https://admanager.google.com/home/) ad server account:
0 commit comments