Hello there!
I am using AWS Amplify Analytics with Pinpoint to track my application's metrics.
- I am using Amplify Gen 1 and V6.
- My Pinpoint and Cognito user pool is in the same region us-east-1 (N. Virginia).
- I am not using Amplify Authenticator. Instead, I am calling the direct API from amplify:
const { isSignUpComplete, userId, nextStep } = await signUp({
...data,
});
const { isSignUpComplete, nextStep } = await confirmSignUp({
username: signUpInfo.userId,
confirmationCode: data.code,
});
const { isSignedIn, nextStep } = await signIn({
username: email,
password,
});
- And recording the metrics from a
useEffect hook:
useEffect(() => {
const addRecords = async () => {
try {
record({
name: "homepage_visited",
});
if (!userData.data) return;
await identifyUser({
userId: userData.data.email!,
userProfile: {
...userData.data,
},
});
} catch (error) {
console.log(error);
}
};
addRecords();
}, []);
- I haven't changed any permissions. All permissions are set by amplify.
Now, Daily active users, Daily active endpoints, and other metrics are working fine.
My Question:
But, Authentication metrics are not working correctly. Sign-ins, sign-ups, and authentication failures always show as empty. Is there any way to fix it?
Is it possible to provide a code example of how to record these auth events? Because I haven't found anything like this in docs. Thank you!
const handleSignUp = async (data) => { try { const { isSignUpComplete, userId, nextStep } = await signUp({ ...data, });