{"record":{"id":"7e7c413e789c2ae2","repo":"medusajs/medusa","slug":"error-identifying-event-for-group-i","errorCode":null,"errorMessage":"Error identifying event for ${\n          \"group\" in data ? data.group.id : data.actor_id\n        }: ${error.message}","messagePattern":"Error identifying event for (.+?): (.+?)","errorType":"exception","errorClass":"MedusaError","httpStatus":500,"severity":"error","filePath":"packages/modules/analytics/src/services/analytics-service.ts","lineNumber":44,"sourceCode":"    return this.analyticsProviderService_\n  }\n\n  async track(data: TrackAnalyticsEventDTO): Promise<void> {\n    try {\n      await this.analyticsProviderService_.track(data)\n    } catch (error) {\n      throw new MedusaError(\n        MedusaError.Types.UNEXPECTED_STATE,\n        `Error tracking event for ${data.event}: ${error.message}`\n      )\n    }\n  }\n\n  async identify(data: IdentifyAnalyticsEventDTO): Promise<void> {\n    try {\n      await this.analyticsProviderService_.identify(data)\n    } catch (error) {\n      throw new MedusaError(\n        MedusaError.Types.UNEXPECTED_STATE,\n        `Error identifying event for ${\n          \"group\" in data ? data.group.id : data.actor_id\n        }: ${error.message}`\n      )\n    }\n  }\n}\n","sourceCodeStart":26,"sourceCodeEnd":53,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/analytics/src/services/analytics-service.ts#L26-L53","documentation":"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.","triggerScenarios":"Calling analyticsModuleService.identify({actor_id/group, ...}) where the provider rejects the request — bad credentials, unreachable service, invalid traits/actor payload.","commonSituations":"Misconfigured provider credentials in module options; provider outage; group/actor payload with fields the provider rejects (wrong types, missing required traits).","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await analyticsService.identify({ actor_id: userId, ... })\n} catch (e) {\n  if (e.type === 'unexpected_state' && /^Error identifying event/.test(e.message)) {\n    logger.warn(`analytics identify failed: ${e.message}`)\n    return\n  }\n  throw e\n}","preventionTips":["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"],"tags":["analytics","provider","third-party","wrapper"],"backgroundTag":"provider-call-failed","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}