# Custom events
Those are standard User.com Events created by you and will contain any information you provide (consent value, form field value etc). Read more in Events documentation. (opens new window)
# Sending Custom Event
To create custom event, implement UserComEvent
:
- Kotlin
- Java
@Event(name = "Example Name")
class MyCustomEvent(
private val exampleString: String,
private val exampleBool: Boolean
) : UserComEvent {
override fun toFlat(): MutableMap<String, Any> {
return mutableMapOf(
"Example Attr 1" to exampleString,
"Example Attr 2" to exampleBool
)
}
}
With @Event
annotation you can define name of your custom event that will be sent in request to User.com. Otherwise MyCustomEvent.getClass().getSimpleName()
will be used.
# Available value types
Available value types that you can send in request to User.com are:
- string -
"this is a string"
- integer -
492
- boolean -
True
- date and time -
2017-09-28T12:51:33.137Z