Here are some tips that might help you when you encounter errors. When you investigate the error root cause with the error details and logs, please also check these items.
Are you using the latest SDK?
The sample code is written based on the latest SDKs. Some issues could have been resolved in the latest version, so please make sure to use the latest SDKs.
Is the AppID correct?
Make sure to initialize the code with the Kii.initializeWithSite() as described in Adding the SDK to Your Web App. If you are developing multiple applications, make sure that the correct AppID is specified.