Jasonette extension for integrating segment.io
See the Android version here
- Install the extension using Jason Extension Manager
- Get an API key from segment.io
- From your XCode project, open
segment.plist
. Add your API key to thekey
property.
Implements identify
{
“type”: “$segment.identify”,
“options”: {
“id”: “…”,
“traits”: {…}
}
}
Implements tracking
{
“type”: “$segment.track”,
“options”: {
“event”: “…”,
“properties”: {
}
}
}
All $segment actions propagates the return value from its previous action onto the next action.
For example, take a look at this example:
{
"type": "$network.request",
"options": {
"url": "https://www.jasonbase.com/things/n3s.json"
},
"success": {
"type": "$segment.track",
"options": {
"event": "response",
"properties": {
"json": "{{$jason}}"
}
},
"success": {
"type": "$render"
}
}
}
Above works the same as the following JSON (Except that the results are sent to segment.io between network.request
and render
)
{
"type": "$network.request",
"options": {
"url": "https://www.jasonbase.com/things/n3s.json"
},
"success": {
"type": "$render"
}
}
This is because the $segment.track
action propagates the $jason
object from $network.request
onto the next action ($render
)