Campaign event data stream from Amazon Pinpoint
If you use Amazon Pinpoint to send campaigns through a channel, Amazon Pinpoint can stream event data about those campaigns. After you set up event streaming, Amazon Pinpoint retrieves your app's event data for email or SMS messages that you send from a campaign from the destination that you specified during setup for you to view. For detailed information about the data that Amazon Pinpoint streams for email and SMS messages, see Email event data stream from Amazon Pinpoint and SMS event data stream from Amazon Pinpoint. For information about how to set up event streaming, see Set up Amazon Pinpoint to stream app event data through Amazon Kinesis or Amazon Data Firehose .
Campaign event example
The JSON object for a campaign event contains the data shown in the following example.
{ "event_type": "_campaign.send", "event_timestamp": 1562109497426, "arrival_timestamp": 1562109497494, "event_version": "3.1", "application": { "app_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6", "sdk": {} }, "client": { "client_id": "d8dcf7c5-e81a-48ae-8313-f540cexample" }, "device": { "platform": {} }, "session": {}, "attributes": { "treatment_id": "0", "campaign_activity_id": "5473285727f04865bc673e527example", "delivery_type": "GCM", "campaign_id": "4f8d6097c2e8400fa3081d875example", "campaign_send_status": "SUCCESS" }, "client_context": { "custom": { "endpoint": "{\"ChannelType\":\"GCM\",\"EndpointStatus\":\"ACTIVE\", ↳\"OptOut\":\"NONE\",\"RequestId\":\"ec229696-9d1e-11e9-8bf1-85d0aexample\", ↳\"EffectiveDate\":\"2019-07-02T23:12:54.836Z\",\"User\":{}}" } }, "awsAccountId": "123456789012" }
Campaign event attributes
This section defines the attributes that are included in the campaign event stream.
Attribute | Description |
---|---|
event_type |
The type of event. Possible values are:
|
event_timestamp |
The time when the event was reported, shown as Unix time in milliseconds. |
arrival_timestamp |
The time when the event was received by Amazon Pinpoint, shown as Unix time in milliseconds. |
event_version |
The version of the event JSON schema. TipCheck this version in your event-processing application so that you know when to update the application in response to a schema update. |
application |
Information about the Amazon Pinpoint project that's associated with the event. For more information, see the Application table. |
client |
Information about the endpoint that the event is associated with. For more information, see the Client table. |
device |
Information about the device that reported the event. For campaign and transactional messages, this object is empty. |
session |
Information about the session that generated the event. For campaigns, this object is empty. |
attributes |
Attributes that are associated with the event. For events that are reported by one of your apps, this object can include custom attributes that are defined by the app. For events that are created when you send a campaign, this object contains attributes that are associated with the campaign. For events that are generated when you send transactional messages, this object contains information that's related to the message itself. For more information, see the Attributes table. |
client_context |
Contains a custom object, which contains an
endpoint property. The endpoint property
contains the contents of the endpoint record for the endpoint that the
campaign was sent to. |
awsAccountId |
The ID of the AWS account that was used to send the message. |
Application
Includes information about the Amazon Pinpoint project that the event is associated with.
Attribute | Description |
---|---|
app_id |
The unique ID of the Amazon Pinpoint project that reported the event. |
sdk |
The SDK that was used to report the event. |
Attributes
Includes information about the campaign that produced the event.
Attribute | Description |
---|---|
treatment_id |
If the message was sent using an A/B test campaign, this value
represents the treatment number of the message. For standard
campaigns, this value is |
campaign_activity_id |
The unique ID that Amazon Pinpoint generates when the event occurs. |
delivery_type |
The delivery method for the campaign. Don't confuse this
attribute with the For channels that support only one endpoint type, the
However, this condition isn't always true for channels that
support different endpoint types, such as custom channels. You
can use a custom channel for different endpoints, such as EMAIL,
SMS, CUSTOM, and so on. In this case, the
Possible values are:
|
campaign_id |
The unique ID of the campaign that the message was sent from. |
campaign_send_status |
Indicates the status of the campaign for the target endpoint.
Possible values include:
|
Client
Includes information about the endpoint that was targeted by the campaign.
Attribute | Description |
---|---|
client_id |
The ID of the endpoint that the campaign was sent to. |