Demand Conversion Platform Users
This article is dedicated to users who haven't been upgraded to the Demand Conversion Platform yet or were/are former Legacy users.
If you only had or have been upgraded to the Demand Conversion Platform instance in Chili Piper, check this article instead!
Overview
With the Concierge Inbound Router, we offer two solutions to help convert your inbound leads into booked meetings:
- Embedded Snippet: Just insert it in your form and post-form pages. Everything will work the same way as before, except that your qualified prospects will be prompted to book a meeting with the right calendar at the right time.
- JS API: Call Chili Piper from your JavaScript code to fully control the workflow.
- REST API. Server to Server. Most Advanced - Used primarily for InApp use cases or where including third-party scripts is not possible. Please contact your Customer Success Manager or Chili Piper Support for more documentation about this method.
Getting Started
- Make sure you create your Inbound Router in our admin. Directions on how to create your first inbound Router here
- You must ensure your Salesforce settings are correct (you need a "Default Booker" with write access to create your leads in Salesforce).
- Ensure you add the queues that specify booking rules (e.g., mid-size companies get routed to the mid-size account executive team on a round-robin basis).
- At the bottom of the Router, you will find the code you need to embed below.
Embedded Snippet
Chili Piper's embedded snippet collects data from forms in the background via the DOM.
The code to insert is:
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.scheduling("byte2bite", "inbound-router")</script>
where
ChiliPiper.scheduling(subdomain, router, options)
subdomain = subdomain of account
router = id of form scheduler
options = additional options (see below)
Javascript API
Insert marketing.js
to your webpage.
Instead of passively using ChiliPiper.scheduling
, have your javascript code call our ChiliPiper.submit function:
<script>ChiliPiper.submit("domain", "inbound-router")</script>
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
Calling ChiliPiper.submit
will trigger the following actions:
- Collect form data if there is a form on the page (including hidden values) and/or receive key-value data as parameters in the Options object (they will be merged if you're using both).
- Call Chili Piper API endpoint.
- Optionally (based on Concierge settings), the Lead/Contact will be created in Salesforce or updated, if it exists, with the form values, including hidden values.
- The Router's logic will be executed (based on Queues) and return the booking calendar link.
- The booking calendar is displayed in an iFrame in a lightbox
- Once the slot is selected and the meeting is booked, you can choose among three options: 1) provide us with redirection settings, and the user will be redirected or 2) use the onSuccess parameter, onSuccess callback will be executed, or 3) nothing, the user can just close the box.
To pass on parameters, use the Salesforce Lead object's data structure – you can find it at Workbench or Salesforce Developers. More details on the lead: {[Object]} option below.
Options
const options = {
skipFormFallbackUponAccountDQ: boolean,
formId: string,
query: string,
debug: boolean,
map: boolean,
domain: string,
router: string,
titleStyle: string,
lead: {[Object]},
onSuccess: function,
onError: function,
onClose: function,
onRouted: function,
domElement: string,
closeOnOutside: boolean,
dynamicRedirectLink: string,
mobileRedirectLink: string,
locale: language_code,
webHook: URL,
disableRelation: boolean,
skipOwnershipLogic: boolean,
ownerId: SFDC_UserId,
event: {[Object]},
accountId: string,
type: string
<script>ChiliPiper.submit("account-name", "example-router", {
formId: "form_Id" })</script>
<script>ChiliPiper.scheduling("account-name", "example-router", {
type: "default-meeting" })</script>
query: string
For advanced use cases, when the formId isn't generated on the page until load time or when the id is variable/dynamic. In these cases, we can query for any element that matches a string we provide instead.
Formatted as query: 'Element[attribute{^/*}="string"]'
^ = "starts with"
* = "contains"
query: 'form[id^="abc"]' - The Id starts with the characters you define
query: 'form[id*="abc"]' - The Id Contains the characters you define
Note: When a query is used, the formId option does not need to be included.
As an extended example, this will trigger Concierge for all <form> elements, with a class name of "hubspot":
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("domain", "inbound-router", { query: 'form[class*="hubspot"]' } )</script>
map: boolean
If this is set to map: true
we will rely on the form mapping within Chili Piper to ensure your form values are associated with the proper Lead / Contact object. This is the default value on most forms.
If this is set map: false
we will assume you are submitting values in the Salesforce Lead Object format. Custom field names will not be supported and may be mapped to Salesforce incorrectly (or not at all).
webHook: URL
To return the data upon booking to a specific location via webhook and inform you of reschedules, re-assignment, or cancellations, we need a webhook. We suggest you pass the URL for the webhook in each request. That way, you can change it at any time. So you will add a parameter in the Booking Request. Works with ChiliPiper.submit(), ChiliPiper.scheduling(), ChiliPiper.getQuery(), and ChiliPiper.showCalendar().
Example:
<script>The post when the webhook fires will be of the following format:
ChiliPiper.submit("account-name", "example-router", {
webHook: "https://hooks.zapier.com/hooks/catch/1127216/o1f1jpf/"
})</script>
{
"routeId: "5a7c654a2b52873a2ce5df57",
"eventId": "5b2124533a906b5f0bff32ad",
"assigneeId": "00D1N000001S8LUUA0",
"actionType":"reassign",
"slot": { "start": 1536355315, "end": 1536356315 }
}
lead: {[Object]}
Helpful for running Chili Piper via a button click or within your web app. Pass parameters directly to ChiliPiper.submit() - This only works when using ChiliPiper.submit() and does not work with ChiliPiper.scheduling().
<script>ChiliPiper.submit("account-name", "example-router", {map:true,
lead: {
FirstName: "Test",
LastName: "Test",
Email: "test@test.com"}
})</script>
domElement: string
Valuable when you want to embed the calendar within a page or the modal window to load within a specific element of your site (i.e.: inline div) rather than as a popup.
domElement value can be either a selector (id, class, etc.) or a direct reference to the dom node. It will work in either case.
domElement: "#main",
More information on this setup can be found in this article.
onSuccess: function
This will call a function after a successful booking. A time-specific redirect can be defined within the Router UI under "Router Redirect," this option is not always required and is used with more custom form integrations.
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("account-name", "example-router", {
onSuccess: someFunction() })</script>
onError: function
This will call a function when a lead is submitted but does not match any queue rules and cannot be routed. Thus no calendar is displayed. This is usually when someone is disqualified from booking. A redirect can be specified within the Router UI under "Router Redirect," this option is not always required and is used with more custom form integrations.
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("account-name", "example-router", { onError: someFunction() })</script>
onClose: function
This will call a function when a lead is submitted and displays the option to book (meaning the lead has qualified for a meeting) but exits the booking module. A redirect can be specific within the Router UI under "Router Redirect," so this option is not always required and is used with more custom form integrations.
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("account-name", "example-router", {
onClose: someFunction() })</script>
onRouted: function
This will call a function when Chili Piper has received a lead's submission and a routing attempt has been made, whether successful or not. This will occur before the onSuccess, onError, or onClose functions are executed to indicate routing has begun.
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("account-name", "example-router", {
onRouted: someFunction() })</script>
More on these Callback methods can be found in this article with sample use cases.
closeOnOutside: boolean
This is a DOM listener option. By default, it is set to false, and clicking the "X" within the booking module will close the calendar UI. When you select the option closeOnOutside: true, this will allow the Chili Piper booking module to be "closed" when the lead clicks outside the booking frame. Any redirect settings for those who don't book or the onClose: function will be triggered when the lead clicks outside the module. We recommend against enabling this option for conversion purposes to prevent accidental closures unless there is a specific reason.
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("account-name", "example-router", {
closeOnOutside: true })</script>
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("account-name", "example-router", {
dynamicRedirectLink: "https://www.chilipiper.com" })</script>
Ex: mobileRedirectLink: "https://www.chilipiper.com"
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("account-name", "example-router", {
mobileRedirectLink: "https://www.chilipiper.com" })
</script>
locale: language_code
Here are all the supported languages and respective locale codes to use when passing this parameter to us.
Ex:
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.scheduling("account-name", "router-name", {
locale: "de_DE" })
</script>
The example above would force the calendar to render in German, regardless of the users' browser settings, per the { locale: "de_DE" }
option.
event: {[Object]}
Like our REST API, you can pass custom field values to the Event object using the following format. Useful to map fields to a Lead/Contact and an Event during the booking process.
<script src="https://js.chilipiper.com/marketing.js" type="text/javascript"></script>
<script>ChiliPiper.submit("account-name", "router-name", {
event: { your_custom_field__c: "12345" }
})
</script>
Unlike our REST API, the event object sits nested within the options object.
accountId: string
The SFDC ID of an Account. Forces a Contact to be created under the account passed to us. Accepts both 15 and 18 Digit Salesforce AccountId values.
ChiliPiper.submit("client_domain", "some-router", { lead: { FirstName: "John", LastName: "Doe", Email: "jdoe@chilipiper.com", Phone: "324-867-5309", }, accountId: "0015c00002FIJ7wAAH" })
Note that the option for Chili Piper to create Leads and Contacts must be enabled within your Router Settings.
Details on Handling Edge Cases and Duplicate Records
a) If no record exists (lead or Contact) by email, then create a Contact in SFDC under the Account that was passed to us
b) If a i.Lead or ii.Contact Exists, but the Contact is in another Account, create a net new Contact under the Account ID passed to us.
c) If a single Contact exists under that Account (by email), use that Contact and don't create a new one.
d) If multiple Contacts exist with that email address, one of which is associated with the AccountId in question, then use the Contact ID from the accountId value passed
To set the options outside of the main script tag:
const options = { onSuccess: function(data){ // ... }, }
ChiliPiper.submit("byte2bite", "inbound-router", options)