Let customers start a conversation with you by adding a Business Chat button to your website.
You can place the
<script> tag in one of two places:
<head>...</head>element of the page.
</body>element at the end of the page.
The script automatically triggers when the webpage loads into the browser. It finds all button containers on the page and converts them into Business Chat buttons, as seen in Figure 1, with the configuration you specify within the
Add a Container for the Business Chat Button
<div> tags wherever you want to include a Business Chat button on the webpage. The
<div> tag must include the following:
A class attribute with the value
data-apple-business-idattribute with the business ID you received when you registered your company with Business Chat.
For example, here is the base structure of what your
<div> tag for the Buisness Chat button should look like:
Business Chat Button Data Attributes
Configuration for the button passes through as
data-* attributes for the
<div> tag. The following data attributes are supported:
Identifies and routes messages to the owner of the business chat ID. Insert your Business Chat ID between the quotes. For example, "
insert your business id here".
The intent for initiating the chat conversation. This can be anything that you specify; for example, "
account statement" or "
track order". (Optional)
The group to receive chat messages based on the message's intent. For example, "
billing department" or "
Theme for the button, with “
light” and “
dark” supported. Use “
light” if using the button on a webpage with a lighter background, and “
dark” if using with a darker background. If not specified, “
light” is used. (Optional)
Language in which to show the button, in ISO 639-1 language code and ISO 3166-1 region code. For example, "
it-it" specifies the language as Italian and the region as Italy. The button’s default behavior is to use the browser’s locale to set the language. In Italy, however, set this attribute to
it-it(Italian-Italy) to override the browser’s default locale. (Optional)