Segment
This guide describes how to add and configure Segment integration.

About Integration

Apphud can send events to Segment. From there you can resend them to any of Segment's integration partners.

How to Add Integration?

Step 1
Step 2
Step 3
Step 4
At Apphud go to "Integrations" section and add Segment:
Enter Write Key and Sandbox Write Key (optional). You can enter the same key as we include environment field in the payload.
You can enter your custom event names or disable some:
Enable integration and click Save:

Data Payload

Apphud sends the following payload in each event:
1
{
2
"context": {
3
"environment": "sandbox",
4
"library": {
5
"name": "apphud",
6
"version": "1.0"
7
}
8
},
9
"event": "subscription_started",
10
"integrations": {},
11
"messageId": "api-1hgkJuoUuv76lwoJE1n5nAJHh9r",
12
"originalTimestamp": "2020-09-18T14:40:53Z",
13
"properties": {
14
"currency": "USD",
15
"local_price": 17.99,
16
"product_id": "com.apphud.weeklytrial",
17
"usd_price": 17.99
18
},
19
"receivedAt": "2020-09-18T14:40:53.445Z",
20
"timestamp": "2020-09-18T14:40:53.000Z",
21
"type": "track",
22
"userId": "test_user_id"
23
}
Copied!
And sends the following payload for each subscriber:
1
{
2
"context": {
3
"environment": "sandbox",
4
"library": {
5
"name": "apphud",
6
"version": "1.0"
7
}
8
},
9
"integrations": {},
10
"messageId": "api-1hgkJsgDKPp9GyIxMTUVqFXKiCd",
11
"originalTimestamp": "2020-09-18T14:40:52Z",
12
"receivedAt": "2020-09-18T14:40:53.223Z",
13
"timestamp": "2020-09-18T14:40:52.000Z",
14
"traits": {
15
"age": null,
16
"email": null,
17
"gender": null,
18
"name": null
19
},
20
"type": "identify",
21
"userId": "test_ren6_4"
22
}
Copied!
You can set age, email, gender and name properties using User Properties features – check mobile SDK documentation.
Last modified 1yr ago