Scenario
Let’s expand this a bit with a real-life scenario: Your customer has an external website that allows their customers to log in and they want to add SuperOffice chat to this page. This website exists outside our ecosystem, so you know that our authentication mechanism will not work, but you would prefer that customers would not have to manually fill out the pre-chat form as they already have authenticated.How to solve this?
It is possible to expand the script tag with data-attributes to pass values into the pre-chat form. The following 4 attributes are supported:- Name: data-customerName = “John Rowling”
- Email: data-customerEmail = “john@mailinator.com”
- Phone: data-customerPhone = “12345678”
- Company: data-companyName = “Liberty Inc”
data-customerName="cookie:someValue"?: Get the value from the cookie named “someValue”data-customerName="url:someParameter": Get the value from the URL parameter named “someParameter”data-customerName="variable:someVar": Get the value from the JavaScript variable named “someVar” (“window.someVar”)
