Campaign events - Amazon Pinpoint

Campaign events

If you use Amazon Pinpoint to send campaigns through any channel, Amazon Pinpoint can stream event data about those campaigns. This includes event data for any email or SMS messages that you send from a campaign. For detailed information about the data that Amazon Pinpoint streams for those types of messages, see Email events and SMS events.

Sample event

The JSON object for a campaign event contains the data shown in the following sample.

{ "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", "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:

  • _campaign.send – Amazon Pinpoint executed the campaign.

  • _campaign.opened_notification – For push notification campaigns, this event type indicates that the recipient tapped the notification to open it.

  • _campaign.received_foreground – For push notification campaigns, this event type indicates that the recipient received the message as a foreground notification.

  • _campaign.received_background – For push notification campaigns, this event type indicates that the recipient received the message as a background notification.

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.

Tip

Check 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 0.

campaign_activity_id The unique ID that Amazon Pinpoint generates when the event occurs.
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:
  • SUCCESS – The campaign was successfully sent to the endpoint.

  • FAILURE – The campaign wasn't sent to the endpoint.

  • DAILY_CAP – The campaign wasn't sent to the endpoint because the maximum number of daily messages have already been sent to the endpoint.

  • EXPIRED – The campaign wasn’t sent to the endpoint because sending it would exceed the maximum duration or sending rate settings for the campaign.

  • QUIET_TIME – The campaign wasn't sent to the endpoint due to quiet time restrictions.

  • HOLDOUT – The campaign wasn't sent to the endpoint because the endpoint was a member of the holdout group.

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.