medusajs/medusa · error · MedusaError
Error identifying event for ${ "group" in data ? d
Error message
Error identifying event for ${
"group" in data ? data.group.id : data.actor_id
}: ${error.message} What it means
Thrown by the analytics module's identify() when the configured analytics provider's identify() call fails; wraps the provider error message with the group id or actor id that was being identified. Like track(), this is UNEXPECTED_STATE and points at the provider, not the module.
Source
Thrown at packages/modules/analytics/src/services/analytics-service.ts:44
return this.analyticsProviderService_
}
async track(data: TrackAnalyticsEventDTO): Promise<void> {
try {
await this.analyticsProviderService_.track(data)
} catch (error) {
throw new MedusaError(
MedusaError.Types.UNEXPECTED_STATE,
`Error tracking event for ${data.event}: ${error.message}`
)
}
}
async identify(data: IdentifyAnalyticsEventDTO): Promise<void> {
try {
await this.analyticsProviderService_.identify(data)
} catch (error) {
throw new MedusaError(
MedusaError.Types.UNEXPECTED_STATE,
`Error identifying event for ${
"group" in data ? data.group.id : data.actor_id
}: ${error.message}`
)
}
}
}
View on GitHub (pinned to 5e06e544a2)
Solutions
- Read the wrapped error.message for the provider's own failure reason
- Validate the credentials and endpoint configured for the analytics provider
- Check that actor_id/group and traits match the provider's expected payload shape
- Retry if the provider failure was transient
Defensive patterns
Strategy: try-catch
Try / catch
try {
await analyticsService.identify({ actor_id: userId, ... })
} catch (e) {
if (e.type === 'unexpected_state' && /^Error identifying event/.test(e.message)) {
logger.warn(`analytics identify failed: ${e.message}`)
return
}
throw e
} Prevention
- Wrap identify() so auth/provider failures never block user flows
- Verify provider credentials in module config on deploy and after key rotation
- Keep identify payloads minimal and typed to the provider's trait schema
When it happens
Trigger: Calling analyticsModuleService.identify({actor_id/group, ...}) where the provider rejects the request — bad credentials, unreachable service, invalid traits/actor payload.
Common situations: Misconfigured provider credentials in module options; provider outage; group/actor payload with fields the provider rejects (wrong types, missing required traits).
Related errors
- Error tracking event for ${data.event}: ${error.message}
- MFA provider "${method}" does not support setup
- MFA provider "${method}" does not support setup verification
- MFA method "${method}" does not support recovery code genera
- Trying to register a fulfillment provider without an identif
AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27).
Data as JSON: /api/errors/7e7c413e789c2ae2.
Report an issue: GitHub.