Injecting custom guest attributes into Genesys Cloud Web Messaging widget

Trying to understand how to properly inject custom guest attributes for authenticated users into the Genesys Cloud Web Messaging widget. I am using the standard JavaScript snippet in my Rails view.

I attempted to set the guestAttributes object via genesyscloud.setProperties() before initialization, passing user ID and tier. The widget loads, but the attributes do not appear in the /conversations/messages webhook payload.

Is there a specific SDK method or timing constraint I am missing to ensure these attributes persist to the backend conversation context?

You need to pass guestAttributes via genesyscloud.setProperties before calling genesyscloud.init(). The JSON structure must match the API schema exactly.

{
 "guestAttributes": {
 "userId": "12345",
 "tier": "premium"
 }
}

If attributes are missing in webhooks, verify the widget configuration allows custom attributes. I manage this via Terraform for consistency.