• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

New users are never counted — all users appear as Returning Users after launch

Scheduled Pinned Locked Moved Unsolved General
3 Posts 2 Posters 23 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gyutaelee
    wrote last edited by
    #1

    Our Authentication Architecture

    We use BrainCloud External Authentication (AuthenticateExternal) as our primary auth method.
    We do not use AuthenticateAnonymous at all.

    Our flow is:

    1. Client calls our own backend server with a device identifier (SystemInfo.deviceUniqueIdentifier)
    2. Our server creates/finds an account in our own identity provider using a deterministic anonymous ID derived from the device identifier
    3. Our server then calls BrainCloud S2S API (SYS_CREATE_USER_EXTERNAL_AUTH) to create a BrainCloud profile before returning a response to the client
    4. Our server returns a user ID and access token to the client
    5. 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 AuthenticateExternal is called and the profile already exists (created earlier via SYS_CREATE_USER_EXTERNAL_AUTH S2S), does BrainCloud return "newUser": "false" — even if the user has never called AuthenticateExternal before?

    Q2. Does BrainCloud's New User analytics (retention cohorts, DAU new/returning breakdown) rely on the newUser flag from AuthenticateExternal, on the profile's createdAt timestamp, 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 AuthenticateExternal call as a New User event?
    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote last edited by
    #2

    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.

    1 Reply Last reply
    0
  • G Offline
    G Offline
    gyutaelee
    wrote last edited by
    #3

    Thank you for your response.

    How will I be notified of the development team’s response after I forward this to them? (Will I only be able to find out through the update log later?)

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users