Skip to main content

Amplitude

Our real-time data streaming infrastructure is built on-top of the AWS Kinesis Data Streams service, as such we will be connecting Amplitude to Shaped via the Kinesis Data Stream Event Streaming Destination.

To begin connecting your Amplitude account, create a Shaped dataset with schema_type: AMPLITUDE, the event schema will be automatically created based on the Amplitude event specification. Once in ACTIVE state, you can access the Kinesis Data Stream name and IAM Role ARN to configure the Amplitude Data Destination, found via the Shaped CLI or API.

Create the Shaped Dataset

The first step is to provision your dataset using the Shaped CLI. You'll need to create the file below.

amplitude_events.yaml
name: amplitude_events
schema_type: AMPLITUDE
shaped create-dataset --file amplitude_events.yaml

Verify that the dataset has successfully created on the Dashboard.

Retrieve Your Dataset Details with Shaped CLI

shaped view-dataset --dataset-name amplitude_events

dataset_name: amplitude_events
dataset_uri: https://api.shaped.ai/v1/datasets/amplitude_events
schema_type: AMPLITUDE
dataset_schema: <event_schema>
kinesis_stream_arn: arn:aws:kinesis:us-east-2:11111111111:stream/ShapedDatasetStream-abc123
kinesis_iam_role_arn: arn:aws:iam::11111111111:role/ShapedDatasetAccessRole-abc123
info

You can also use the Shaped API to get the dataset details

curl -X GET "https://api.shaped.ai/v1/datasets/amplitude_events" \
-H "x-api-key: <API_KEY>"

Now that we have the dataset details, we can add them to your Amplitude dashboard.

Configuring Amplitude

In order to forward events from Amplitude to Kinesis you will need to perform the following steps in the Amplitude dashboard:

  1. In Amplitude, navigate to 'Data Destinations' then find 'Kinesis Data Stream - Event Stream'. Enter a sync name, then click 'Create Sync'.
  2. Click Edit, then enter the following details:
    • AWS Kinesis Stream Name
    • AWS IAM Role Resource Name (ARN)
    • AWS Region: us-east-2
  3. Use the 'Send Events' filter to select the events you want to send. You can send all events, but our team recommends choosing the most important events that indicate user engagement on your content.
  4. When finished, enable the destination and save.
Finding "Stream Name"

"Stream Name" is the last string value on the kinesis_stream_arn property value. In the example above, it would be ShapedDatasetStream-abc123