DavidWells / analytics

Lightweight analytics abstraction layer for tracking page views, custom events, & identifying visitors
https://getanalytics.io
MIT License
2.38k stars 240 forks source link

AWS Pinpoint identifier not found - Address #364

Open KinGwaL opened 1 year ago

KinGwaL commented 1 year ago

Hi! Im working on AWS Pinpoint integration and everything looks amazing, but except the identify function seems can't pass the Address into Pinpoint (https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-endpoints.html) which affect the endpoint can't be used in AWS console, any missing from my side to make this work?

analytics.identify('user-id-xyz-6', { firstName: 'bill', lastName: 'murray', email: 'bill@example.com', Address: 'bill@example.com' })

Endpoint { Attributes {lastSessionDate: ["2023-02-22T05:10:03.909Z"], lastSession: ["641b9679-3fa0-4c5c-bf2b-a059310718d5"],…} Demographic {AppVersion: "awesome-app-testing-123456@0.0.0", Locale: "zh_tw", Make: "Google", Model: "Chrome",…} Location {} Metrics {sessions: 139, pageViews: 56} RequestId "5a73c0e7-dca8-4071-bcbd-69ec859b06e4" User {UserId: "user-id-xyz-6",…} }

Right now all traits is stay under Endpoint.User object, I would like to see any quick around to make Address under Endpoint object. Thank you!

DavidWells commented 1 year ago

Oh interesting. What is Address used for?

Yeah the object goes into the User.UserAttributes right now here https://github.com/DavidWells/analytics/blob/master/packages/analytics-plugin-aws-pinpoint/src/browser.js#L301