Recording real-time item interaction events - Amazon Personalize

Recording real-time item interaction events

An item interaction event is an interaction between a user and an item in your catalog. For example, a user purchasing shoes or watching movie.

Record real-time item interaction events as you show your customer item recommendations. This builds out your interactions data and keeps your data fresh. And it tells Amazon Personalize about the current interests of your user, which can improve recommendation relevance.

You record item interaction events with the PutEvents API operation. Amazon Personalize appends the event data to the Item interactions dataset in your dataset group. If you record two events with exactly the same timestamp and identical properties, Amazon Personalize keeps only one of the events. You can record item interaction events using the AWS SDKs, AWS Amplify, or AWS Command Line Interface (AWS CLI).

If you use Apache Kafka, you can use the Kafka connector for Amazon Personalize to stream item interactions in real time to Amazon Personalize. For information see Kafka Connector for Amazon Personalize in the personalize-kafka-connector Github repository.

AWS Amplify includes a JavaScript library for recording item interaction events from web client applications, and a library for recording events in server code. For more information, see Amplify - analytics.

Requirements for recording item interaction events and training a model

To record item interaction events, you need the following:

  • A dataset group that includes an Item interactions dataset, which can be empty. If you went through the Getting started tutorials guide, you can use the same dataset group and dataset that you created. For information on creating a dataset group and a dataset, see Importing training data into Amazon Personalize datasets.

  • An event tracker.

  • A call to the PutEvents API operation.

  • If you use an AWS Lambda function to call the PutEvents operation, your function's execution role must have permission to perform the personalize:PutEvents action with the wildcard * in the Resource element.

You can start out with an empty Item interactions dataset and, when you have recorded enough data, train the model using only new recorded events. For all use cases (Domain dataset groups) and recipes (Custom dataset groups), your interactions data must have the following before training:

  • At minimum 1000 item interactions records from users interacting with items in your catalog. These interactions can be from bulk imports, or streamed events, or both.

  • At minimum 25 unique user IDs with at least two item interactions for each.

For quality recommendations, we recommend that you have at minimum 50,000 item interactions from at least 1,000 users with two or more item interactions each.