【问题标题】:How to trace my Analytics.record() event sent to AWS Personalize?如何跟踪发送到 AWS Personalize 的 Analytics.record() 事件?
【发布时间】:2019-07-12 05:39:11
【问题描述】:

我正在尝试向 AWS-Personalize 发出“Identify”类型的事件。但是,除了类型之外,没有规定可以查看事件:AWSPinpoint 内的会话开始和会话结束

还尝试编辑 Pinpoint 策略以使其使用 .record() api,如下所示...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));

我能够获取 identityId,但是,我没有看到 AWS Personalize 内的事件跟踪器中记录的任何事件。我只能看到 Pinpoint 中的 Session Start 和 Session End 事件

【问题讨论】:

    标签: javascript aws-amplify aws-pinpoint amazon-personalize


    【解决方案1】:
    1. 有时需要一段时间才能显示事件。
    2. 另外,Analytics.record 仅适用于custom events。它的 API 不需要 eventTypeproperties 密钥。

    您可以像这样跟踪自定义事件:

    import Analytics from '@aws-amplify/analytics';
    
    Analytics.record({
      name: 'videoView',
      attributes: { content: 'gaming', creator: 'Geromekevin' },
      metrics: { minutesWatched: 14 },
    });
    

    在您的应用程序中调用该函数几分钟后,它们应该会显示在您的控制台中。

    【讨论】:

    • 我实际上正在研究 Amazon 新的 ML 辅助个性化解决方案 - AWS Personalize。此处的文档另有建议...@ 987654322@。这个操作确实需要 eventType 和 properties 属性
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多