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

RevenueCat x Braze for user_alias drops external_id and breaks integration #4701

Closed
5 tasks done
nsarno-lucid opened this issue Jan 23, 2025 · 2 comments
Closed
5 tasks done
Labels

Comments

@nsarno-lucid
Copy link

Describe the bug

The iOS SDK docs supports sending user_alias fields to Braze:
https://www.revenuecat.com/docs/integrations/third-party-integrations/braze

Purchases.shared.attribution.setAttributes(["$brazeAliasName": "name", "$brazeAliasLabel": "label"])

However, if we set this value, the external_id gets dropped from the payload when sending to Braze and then Braze does not recognize the event.

The following event sends to Braze from RevenueCat, but Braze fails to recognize it on their end:

{
  "events": [
    {
      "name": "revenueCat_trial_started_event",
      "time": "2025-01-22T18:48:17.000000",
      "properties": {
        "product_id": "abc123",
        "store": "STRIPE",
        "revenue": 0,
        "app_id": "abc123"
      },
      "user_alias": {
        "alias_name": "USERID",
        "alias_label": "currentUserId"
      }
    }
  ],
  "attributes": [
    {
      "user_alias": {
        "alias_name": "USERID",
        "alias_label": "currentUserId"
      },
      "rc_active_entitlements": [
        "entitlement"
      ],
      "rc_subscription_status": "trial"
    }
  ]
}

The following event is successfully recognized by Braze, but doesn't have a user_alias set:

{
  "events": [
    {
      "name": "revenueCat_trial_started_event",
      "time": "2025-01-23T19:24:46.000000",
      "properties": {
        "product_id": "abc123",
        "store": "STRIPE",
        "revenue": 0,
        "app_id": "abc123"
      },
      "external_id": "USERID"
    }
  ],
  "attributes": [
    {
      "external_id": "USERID",
      "rc_active_entitlements": [
        "entitlement"
      ],
      "rc_subscription_status": "trial"
    }
  ]
}

Per Braze docs, the example looks like we should be sending both values, external_id always and user_alias if it is available.
https://www.braze.com/docs/api/objects_filters/user_alias_object/#example

Are you able to update this or is the recommendation to not use user_alias?

@RCGitBot
Copy link
Contributor

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@nsarno-lucid
Copy link
Author

Update: It seems the behavior is for user_alias to take priority over external_id. If this is intended, it should be more clear in the docs. Currently it says the brazeAliasName is "optional" which sounds like an additional nice-to-have field and not a replacement of the original.

Closing this because we are reverting to not setting user_alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants