New users are never counted — all users appear as Returning Users after launch
-
Our Authentication Architecture
We use BrainCloud External Authentication (
AuthenticateExternal) as our primary auth method.
We do not useAuthenticateAnonymousat all.Our flow is:
- Client calls our own backend server with a device identifier (
SystemInfo.deviceUniqueIdentifier) - Our server creates/finds an account in our own identity provider using a deterministic anonymous ID derived from the device identifier
- Our server then calls BrainCloud S2S API (
SYS_CREATE_USER_EXTERNAL_AUTH) to create a BrainCloud profile before returning a response to the client - Our server returns a user ID and access token to the client
- The client then calls
AuthenticateExternal(userId, accessToken, externalAuthName, forceCreate: true)
The relevant server-side code (Step 3):
public async Task<AccountData> EnsureExternalAccountAsync(string externalId) { var account = await BrainCloudS2SClient.CallAsync<AccountData>( "friend", "GET_PROFILE_INFO_FOR_EXTERNAL_AUTH_ID_IF_EXISTS", ...); if (string.IsNullOrEmpty(account.BrainCloudProfileId)) { account = await BrainCloudS2SClient.CallAsync<AccountData>( "user", "SYS_CREATE_USER_EXTERNAL_AUTH", ...); } return account; }
The Problem
Since launch, zero users are counted as New Users in the BrainCloud dashboard.
Every user appears as a Returning User.
Questions
Q1. When
AuthenticateExternalis called and the profile already exists (created earlier viaSYS_CREATE_USER_EXTERNAL_AUTHS2S), does BrainCloud return"newUser": "false"— even if the user has never calledAuthenticateExternalbefore?Q2. Does BrainCloud's New User analytics (retention cohorts, DAU new/returning breakdown) rely on the
newUserflag fromAuthenticateExternal, on the profile'screatedAttimestamp, or something else?Q3. If the S2S pre-creation is the cause, what is the recommended pattern?
- Should we remove the S2S pre-creation and let
AuthenticateExternal(forceCreate: true)be the sole profile creator? - Or is there a way to mark an S2S-created profile so BrainCloud still counts the first
AuthenticateExternalcall as a New User event?
- Client calls our own backend server with a device identifier (
-
First of all - from what you describe - you don't need to set forceCreate: true in your authentication call - because the account was already previously created via the S2S call.
Also - since you are creating the accounts via the S2S call, then yes - when you authenticate, newUser will come back as false - since they previously existing (via the S2S call).
That said - we'll have to look into the analytics of this a bit more. Certainly seems like a mismatch... maybe the "fix" would be to return newUser for any user account that had zero logins... and thus let the analytics take care of themselves based on that.
I'll put this to our devs. Thanks for raising it.
Oh - and for Q3 - certainly NOT pre-creating the accounts via S2S would make all this line up correctly.