Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create Analytics identifyUser with EMAIL or SMS or Push notification channel #12721

Open
3 tasks done
pascalito007 opened this issue Dec 19, 2023 · 10 comments
Open
3 tasks done
Assignees
Labels
Analytics Related to analytics feature-request Request a new feature need-product-input Needs non-technical requirements or direction to proceed VP Version parity issues between v5 and v6

Comments

@pascalito007
Copy link

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Analytics

Amplify Categories

analytics

Environment information

# Put output below this line


Describe the bug

When using identifyUser from Analytics, I have no options for channel and optout. This is available in the In-App aws-amplify/in-app-messaging but not in @aws-amplify/analytics.
Before migrating to V6 it was working in V5.

Expected behavior

I should be able to specify channelType and optout in order to identify an analytics pinpoint user.

Reproduction steps

  1. import identifyUser from @aws-amplify/analytics
  2. create an EMAIL segment in pinpoint console
  3. create a journey that send email to users created using identifyUser based on an event
  4. The email is never sent and the user never enter the journey

Code Snippet

import { record, identifyUser } from "@aws-amplify/analytics";

await identifyUser({
          userId: user.userId,
          userProfile: {
            email: "[email protected]",
          },
        });

        record({ name: "TestEvent" });

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@pascalito007 pascalito007 added the pending-triage Issue is pending triage label Dec 19, 2023
@nadetastic nadetastic added the Analytics Related to analytics label Dec 19, 2023
@cwomack cwomack self-assigned this Dec 19, 2023
@cwomack cwomack added investigating This issue is being investigated and removed pending-triage Issue is pending triage labels Dec 19, 2023
@cwomack
Copy link
Member

cwomack commented Dec 20, 2023

@pascalito007, confirmed this is a feature we don't have in v6 out of the box. I'll label this as a feature request and will review it with our team internally! Thank you for creating this issue and just want to confirm the context here. It sounds like you're basically wanting to send an email when an event is recorded, right?

@cwomack cwomack added feature-request Request a new feature and removed investigating This issue is being investigated labels Dec 20, 2023
@pascalito007
Copy link
Author

Yes correct @cwomack I have a pinpoint journey which send EMAIL to EMAIL channel type segment and SMS to sms channel type segment. This is triggered previously in v5 when using updateEndpoint+Analytics event record. I want the same behavior with identifyUser from Analytics + Analytics Event record.

@soplan
Copy link

soplan commented May 15, 2024

Yeah this is stupid that it's not in v6.. I started a new project but am now considering switching back to v5 because this is a very important missing piece of the puzzle. Can we have an estimate?

To give you some context. I use it for Journeys but also for marketing campaigns. I use it to send emails to inactive users or users who are on a specific subscription plan and user subscribed to product update newletters... So pretty much everything in Pinpoint I use to send email to the users in a specific segment (filtered on whether they want to receive newsletters)

@mohammedsahl
Copy link

+1 We use email as our channel. It's crucial for us. Can't upgrade to v6 without it :/

@cwomack cwomack added the VP Version parity issues between v5 and v6 label Jun 4, 2024
@cwomack cwomack removed their assignment Jun 4, 2024
@monholm
Copy link
Contributor

monholm commented Jul 10, 2024

This is also an issue when it comes to push notifications.

We use Pinpoint for push notifications, but don't use aws-amplify/push-notifications to handle said notifications on the (react-native) client side (for various reasons outside the scope of this issue).

Not exposing options such as optOut, address and channelType in identifyUser from aws-amplify/analytics forces us to install @aws-amplify/rtn-push-notification.

If all @aws-amplify/rtn-push-notification did was to provide us a version of identifyUser with the correct interface and maybe some other js functions that we could just ignore, we probably wouldn't care. But @aws-amplify/rtn-push-notification comes with a range of native functionality, that breaks our existing setup.

This includes registering an android service with an intent-filter for the com.google.firebase.MESSAGING_EVENT action and depending on old kotlin-specific firebase dependencies. Long story short, we can't just install @aws-amplify/rtn-push-notification and call it a day.

@cwomack since this was labelled as a feature-request, would you accept a PR that aligns the different identifyUser functions? We're currently patching amplify-js to include the options in analytics, but would really prefer to "fix" it upstream.

@renso3x
Copy link

renso3x commented Nov 14, 2024

Facing similar issue with v6

  1. Using IdentifyUser to update the endpoint:
await identifyUser({
  userId: email,
  userProfile: {
    name: (user?.given_name ?? userProfile?.givenName) as string,
    email,
    customProperties: {
      organizationName: [staffSession.oName],
      product: [PRODUCT],
    },
  },
  options: {
    userAttributes: {
      role: [userProfile?.role as string],
    },
  },
});

record({
  name: `${PRODUCT}_USER_SIGNIN`,
});
  1. This should trigger an event in the journey where the user activity is _USER_SIGNIN, and an email should be sent. However, none of the journey events were triggered.

I was only able to trigger the event by using the following command:

aws pinpoint put-events --application-id 7149cbb8XXXXXXXX --events-request file://PutEvents.json

Downgrading to v5, is also a pain.

Screenshot 2024-11-14 at 1 12 59 PM

@github-actions github-actions bot added the pending-maintainer-response Issue is pending a response from the Amplify team. label Nov 14, 2024
@cwomack
Copy link
Member

cwomack commented Nov 14, 2024

@renso3x, thank you for the additional context here.

@monholm, let me review this again with our team internally and get back as soon as possible. Appreciate the patience from everyone following this issue.

@cwomack cwomack added the need-product-input Needs non-technical requirements or direction to proceed label Nov 14, 2024
@cwomack cwomack self-assigned this Nov 14, 2024
@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Nov 14, 2024
@HemangiVekaria
Copy link

HemangiVekaria commented Dec 2, 2024

I migrated from this

"@aws-amplify/pushnotification": "^3.2.5",
"aws-amplify": "^3.3.1",  

to this

"@aws-amplify/rtn-push-notification": "^1.2.31",
"aws-amplify": "^6.8.2",

Now old version has method to update user token in pinpoint using

import PushNotification from '@aws-amplify/pushnotification';
PushNotification.updateEndpoint(token);

This will update token to pinpoint for notification. Now i am struggling to update token on pinpoint with latest version of aws-amplify.

Can anyone has idea for this? i am struggling since 4 days. I am migrating to latest version and in old notification work properly but after updating aws-amplify to latest push notification is not working.

rtn-push-notification with this i am able to get token. Also if from Aws console i add that token in Test Messaging then i am getting notification in device.

Please help for this.

@github-actions github-actions bot added the pending-maintainer-response Issue is pending a response from the Amplify team. label Dec 2, 2024
@HuiSF
Copy link
Member

HuiSF commented Dec 2, 2024

Hi @HemangiVekaria looking at the code:

PushNotification.updateEndpoint(token);

By the token you meant the device token for registering Push Notification correct? With Amplify V6 you should not need a manual step for this. The library handles token registration automatically. You can review the Push Notification documentation for necessary steps.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Dec 2, 2024
@HemangiVekaria
Copy link

Hi @HemangiVekaria looking at the code:

PushNotification.updateEndpoint(token);

By the token you meant the device token for registering Push Notification correct? With Amplify V6 you should not need a manual step for this. The library handles token registration automatically. You can review the Push Notification documentation for necessary steps.

By default, it sends the token as 'undefined.' I tried the code below, and it successfully sends the token to Pinpoint. Now, I am receiving notifications. I don't know why the token is sent as 'undefined' by default.

import {identifyUser} from 'aws-amplify/push-notifications';
identifyUser({
        address: token,
        channelType: IS_IOS ? 'APNS' : 'GCM',
        userId: `${this.props.user.id}`,
        immediate: true,
      });

@github-actions github-actions bot added the pending-maintainer-response Issue is pending a response from the Amplify team. label Dec 3, 2024
@HuiSF HuiSF removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analytics Related to analytics feature-request Request a new feature need-product-input Needs non-technical requirements or direction to proceed VP Version parity issues between v5 and v6
Projects
None yet
Development

No branches or pull requests

9 participants