The Concierge visitor client is typically loaded last on websites to prevent adverse impact to website performance. Prior to passing data to the JSAPI, it is important to first verify that the API is ready to receive data. You only need to verify that Concierge is ready once per <script> sequence on your page.
Follow the latest version of the Concierge Website Integration Guide, on the Support Portal, for information on how to correctly implement a Promise script that informs your site when the Concierge visitor client is ready for interactions. As not all browsers natively support Promises, two examples are provided; one that leverages native browser support for Promises, and one that leverages a third-party JS library (in this case, jQuery).