2

I am trying to emit an event of type 'Identify' to AWS-Personalize. However there is no provision to see events other than types: Session Start and Session End inside AWSPinpoint

Also tried editing Pinpoint policy to enable it use .record() api as shown here... https://aws-amplify.github.io/docs/js/analytics#update-your-iam-policy

Amplify.Auth.currentUserCredentials()
  .then((user) => {
    setCookie("COGNITO_ID", user.identityId);
    Analytics.record({
      eventType: "Identify",
      properties: {
        "userId": user.identityId,
     }
    }, 'AmazonPersonalize');
  })
  .catch(e => console.log(e));

I am able to get the identityId however, I don't see any event recorded at the Event Tracker inside AWS Personalize. All I can see is Session Start and Session End events inside Pinpoint

1 Answers1

1
  1. Sometimes it takes a while for the events to show up.
  2. Additionally, Analytics.record is only for custom events. Its API doesn't expect a eventType or a properties key.

You can track custom events like this:

import Analytics from '@aws-amplify/analytics';

Analytics.record({
  name: 'videoView',
  attributes: { content: 'gaming', creator: 'Geromekevin' },
  metrics: { minutesWatched: 14 },
});

A view minutes after the function has been invoked inside your app they should show up in your console.

J. Hesters
  • 13,117
  • 31
  • 133
  • 249
  • I am actually working on Amazon's new ML-assisted personalization solution - AWS Personalize. And the docs here suggest otherwise... https://aws-amplify.github.io/docs/js/analytics#working-with-the-api-2. This operation indeed take eventType and properties attributes – Ramakrishnan C S Jul 17 '19 at 05:52