Set a pre-chat form for your chat widget

A pre-chat form will help you know more about users to give them a perfect consultation.
Written by Andrew
Updated 6 months ago

If you want to ask users for their name / email / phone / company or any other custom attributes, use a pre-chat form.

You can configure it in Settings → iOS apps

You can also set up custom attributes in SDK

ObjC:

configuration.userAttributes = 
@[
    // Custom attributes
    [[HCSUserAttribute alloc] initWithAttributeName:@"Custom"
                                        placeholder:@"My custom"
                                           required:true],
    [[HCSUserAttribute alloc] initWithAttributeName:@"Custom2"
                                        placeholder:@"Please enter something"
                                           required:false]
];

Swift:

configuration.userAttributes =
  [HCSUserAttribute(attributeName: "Custom", placeholder: "Custom placeholder", required: true),
   HCSUserAttribute(attributeName: "Custom2", placeholder: "Please enter something", required: false)]

Did this answer your question?