Troubleshooting
Common troubleshooting scenarios and resolutions for the Kustomer Chat 2.0 Web SDK.
This page includes common troubleshooting scenarios and resolutions for the Kustomer Chat 2.0 Web SDK. For additional support, contact [email protected].
Kustomer method calls won't execute
You must first initialize Kustomer Chat with Kustomer.start() and chat must complete initialization before you can successfully call additional methods.
Additional methods cannot run unless Kustomer.start()
has completed in your code.
For example, the Kustomer.open()
and Kustomer.login()
methods in the following code example will not work as expected:
// Kustomer.open() and Kustomer.log() may run before Kustomer.start() finishes chat initialization. This can cause Chat SDK methods to not work as expected.
Kustomer.start();
Kustomer.open();
Kustomer.login({
jwtToken: 'Secure Token'
});
To resolve this issue, you can use Kustomer.start()
in a callback function to call Kustomer.open()
and Kustomer.login
after Kustomer Chat initializes. This guarantees that chat will finish initializing before you call any other Chat SDK methods.
// Call other Chat SDK methods in a callback for Kustomer.start(). This ensures that chat will always finish initalizing before you call the other methods.
Kustomer.start({}, () => {
Kustomer.open();
Kustomer.login({
jwtToken: 'Secure Token'
});
});
When to call other Web SDK methods outside of a callback for Kustomer.start()
There may be instances when you may want to call other Web SDK methods outside of a
Kustomer.start()
callback function. If so, make sure that the code will always finish initializing chat before running any other methods. Otherwise, you risk your method calls not working properly.
Kustomer Chat won't load
Kustomer Chat may not load if:
-
Your chat embed script is located somewhere instead of right before the closing
</body>
tag. This means you cannot put the chat embed script in your<head></head>
tag. -
You embed the chat widget on an unauthorized domain or a page blocked with a URL override under your Chat Management: Domains settings in Kustomer.
-
Your Business Hours Availability in your main Chat Management: Settings are set to Hide Chat outside of your business hours (and you are trying to access the chat widget outside of your set business hours).
-
You use Google Tag Manager (GTM) and try to load chat synchronously: See Use Kustomer Chat with Google Tag Manager.
Check Chat Management: Domains settings
You can check your Chat Management: Domains settings in Kustomer to view and update your domain authorizations and URL overrides.
Check Chat Management: Settings for Business Hours Availability
You can check your Chat Management: Settings in Kustomer to view and update your Business Hours Availability.
Prevent viewport zooming on mobile devices
The viewport may zoom on mobile devices when a customer selects an input in the chat widget.
To prevent viewport zooming on mobile devices, you must update or add a viewport meta tag at the bottom of the <head>
tag in your HTML when you install Kustomer Chat.
Add the following meta tag before the closing </head>
tag in your HTML:
<!-- Add the meta tag before the closing </head> tag -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
Use Kustomer Chat with Google Tag Manager
Kustomer Chat may throw an uncaught TypeError: Kustomer.start is not a function
error message and fail to load synchronously when used with Google Tag Manager (GTM).
To use Kustomer Chat with Google Tag Manager, load chat asynchronously. See Load chat asynchronously.
Updated over 3 years ago