Identify users at sign-in (Android)
The logged in signal is how your Android app tells Connect who just authenticated. The SDK sends an identifier — typically a customer ID or email address — and Connect uses it to match the app visitor to an existing contact or create one. Once the contact is known, marketers can target push notifications to that person and attribute the rest of the session to their profile.
Languages: Kotlin and Java
Availability: Pro, Premium, and Ultimate
How identification works
Two parameters do the identification work:
identifierName— the contact attribute in Connect that the value should be matched against, for exampleCustomer IDorEmail Address.identifierValue— the value itself.
The identifierName must match a contact attribute name exactly as it appears in Connect, including capitalization and spacing. To look up attribute names, in Connect go to Audience > Contacts > Attributes.
Choosing an identifier
Use the most stable identifier your authentication service returns:
- Customer ID (preferred). If your Connect audience has a contact key attribute, use it — this is what Connect uses internally to identify a contact.
- Email address or phone number. Both are standard contact attributes in Connect and work well when no customer ID is available.
When to call
| Moment | Why |
|---|---|
| After successful sign-in | You have a confirmed identifier — the most reliable moment to identify the user. |
| On app launch when the user is already signed in | Ensures returning users are identified on every session, not just when they actively sign in. |
API reference
Connect.logIdentificationEvent(
identifierName: String,
identifierValue: String,
url: String = "http://acoustic.co/test",
signalType: String = "loggedIn",
additionalParameters: Map<String, String> = emptyMap()
): Boolean| Parameter | Required | Description |
|---|---|---|
identifierName | Yes | The contact attribute name in Connect. Must match exactly — case sensitive. |
identifierValue | Yes | The value of the identifier. |
url | No | The screen context for the signal, for example "SignInScreen". |
signalType | Yes | Pass "loggedIn". |
additionalParameters | No | Signal content fields. See Supported fields below. |
Returns false without throwing if either identifierName or identifierValue is blank.
Supported fields in additionalParameters
Required
loginMethod— how the user authenticated, for example"email","passwordless", or"sso".
Optional
ssoProvider— the SSO provider name, for example"Google"or"Apple". Include only for SSO-backed sign-ins.name— a short label for the signal instance. Appears as the signal name in Connect.description— a longer human-readable note describing the event.
Example
Call logIdentificationEvent() after authentication is confirmed — not when the user submits the sign-in form.
authService.signIn(email, password) { result ->
when (result) {
is Success -> {
Connect.logIdentificationEvent(
identifierName = "Email Address",
identifierValue = result.user.email,
url = "SignInScreen",
signalType = "loggedIn",
additionalParameters = mapOf(
"loginMethod" to "email"
)
)
navigateToDashboard()
}
is Failure -> showError(result.error)
}
}Try the sample app
Both sample apps include a working identity screen:
- View-based: IdentityFragment.kt
- Jetpack Compose: IdentityScreen.kt
Troubleshooting
Signal not appearing in Connect?
- Verify
identifierNameandidentifierValueare not empty or whitespace-only. The SDK trims both and returnsfalsesilently if either is blank. - Confirm
identifierNamematches a contact attribute in Connect exactly — including capitalization and spacing. - Confirm the signal fires after authentication is confirmed, not on form submit.
- Confirm
additionalParametersincludesloginMethod. The signal is rejected if this field is missing.
Contact not created or updated?
- Verify the
identifierNamevalue matches a contact attribute defined in Connect. - Attribute values must be passed as strings. If the matching attribute in Connect is typed as a number, Boolean, or date, pass the value as a string representation (for example,
"42","true", or an ISO 8601 date string).
Updated 1 day ago
