How to invoke Embedded Service Chat on click of a button in Salesforce Site?

For custom website(not site), check the following link.

1. Create a Visualforce Page with Embedded Service Deployment Code Snippet.

<apex:page >

    <input type="button" value="Start Chat" onclick="startChat();"/><br/><br/><br/>
    <input type="button" value="Clear Chat Session" onclick="clearSession();"/><br/>
    <!-- Paste your Embedded Service Snippet code here -->
        function startChat() {
            console.log( 'Inside Start Chat' );
                directToAgentRouting: {
                buttonId: "5735f000000Tpl7",
                fallback: true
            extraPrechatInfo: [],
            extraPrechatFormDetails: []
        function clearSession() {
            console.log( 'Inside Start Chat' );

2. Create a site. Use the VF page created in step 1 as the home page.

3. Make the site public. Give access to the VF page created in step 1.

4. Activate the page. Test it.

No comments:

Post a Comment