Concierge Session Variables

Sammie Stephens Updated by Sammie Stephens

Introduction

Session variables can be used to pass through information from the page into the chat bot. Capacity can use those variables as part of the chat interactions. 

Setup the Attachment

  1. Place the Concierge script in the desired webpage, preferably before the end of the <body> ... </body> tag
  2. Place an event listener for the ready event of the document, and calls window.capacityConcierge.setAttachment with the attachment object when the event fires
  3. Attachment object needs to be a flat JSON object with no nested object inside
  4. Once successfully setup, attachment will be sent along with each of the user's inquiry automatically

Sample attachment setup:

This sample attachment will be sent from the page of a loan officer named Mike Charley. Each page will send the first name, last name and email for that specific loan officer.

<div id="ais-concierge"></div><script src="https://cdn.aisoftware.com/concierge/index.js" id="ais-concierge-script" concierge-token="XXXXXXXXXXXXXXXXXXXXXXXXXX"></script>

<script type="text/javascript">

var attachmentForUser = {

    FirstName: "Mike",

    LastName: "Charlie",

    EmailAddress: "mikecharlie@example.com"

    City: "St. Louis"

};

function setConciergeAttachment(attachment) {

    if (window.capacityConcierge) {

        window.capacityConcierge.set_attachment(attachment);

    }

}

document.addEventListener("DOMContentLoaded", function () {

    setConciergeAttachment(attachmentForUser);

});

</script>

How did we do?

Concierge Links

Commonly Used Concepts

Contact