Concierge Session Variables (Legacy 1.0)
The documentation below only applies to our legacy 1.0 Concierge interface. All Concierges created as of April 2024 have been on the 2.0 interface.
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
- Place the Concierge script in the desired webpage, preferably before the end of the ... tag
- Place an event listener for the ready event of the document, and calls window.capacityConcierge.setAttachment with the attachment object when the event fires
- Attachment object needs to be a flat JSON object with no nested object inside
- 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.
<script type="text/javascript">
var attachmentForUser = {
firstname: "Mike",
lastname: "Charles",
emailaddress: "mike.charles@example.com"
city: "St. Louis"
};
function setConciergeAttachment(attachment) {
if (window.capacityConcierge) {
window.capacityConcierge.set_attachment(attachment);
}
}
document.addEventListener("DOMContentLoaded", function () {
setConciergeAttachment(attachmentForUser);
});
</script>
Set up Guided Conversation:
Once the variables are loaded inside the Capacity Concierge Script, please see examples below on how to render these variables.