[SalesForce] Live Agent – Custom Pre-Chat From

I have created a Visualforce page with below details and have it linked on Chat Buttons & Invitations as custom Pre-Chat Form and Site for Resources. However when I click on the chat button it still display a default page generated by Salesforce. What am I doing wrong?

<style type='text/css'>
    .embeddedServiceHelpButton .helpButton .uiButton {
        background-color: #E40000;
        font-family: "Arial", sans-serif;
    }
    .embeddedServiceHelpButton .helpButton .uiButton .helpButtonLabel  .message {
        margin-bottom: 0;
    }
    .embeddedServiceHelpButton .helpButton .uiButton:focus {
        outline: 1px solid #005290;
    }
    .headerText {
        margin: 0;
    }
</style>

<script type='text/javascript' src='https://service.force.com/embeddedservice/5.0/esw.min.js'></script>
<script type='text/javascript'>
    var initESW = function(gslbBaseURL) {
        embedded_svc.settings.displayHelpButton = true; //Or false
        embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US'

        //embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert)
        //embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline)

        //embedded_svc.settings.loadingText = ''; //(Defaults to Loading)
        //embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session)

        // Settings for Chat
        //embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
            // Dynamically changes the button ID based on what the visitor enters in the pre-chat form.
            // Returns a valid button ID.
        //};
        //embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields
        //embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId
        //embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us)

        embedded_svc.settings.enabledFeatures = ['LiveAgent'];
        embedded_svc.settings.entryFeature = 'LiveAgent';

        embedded_svc.init(
            'https://mydom--frtdev.cs76.my.salesforce.com',
            'https://frtdev-mydom--frtdev.cs76.force.com/liveAgentSetupFlow',
            gslbBaseURL,
            '00D9D0000008cXr',
            'POC_Chat',
            {
                baseLiveAgentContentURL: 'https://c.la1-c2cs-ukb.salesforceliveagent.com/content',
                deploymentId: '5729D000000003o',
                buttonId: '5739D000000005V',
                baseLiveAgentURL: 'https://d.la1-c2cs-ukb.salesforceliveagent.com/chat',
                eswLiveAgentDevName: 'POC_Chat',
                isOfflineSupportEnabled: true
            }
        );
    };

    if (!window.embedded_svc) {
        var s = document.createElement('script');
        s.setAttribute('src', 'https://mydom--frtdev.cs76.my.salesforce.com/embeddedservice/5.0/esw.min.js');
        s.onload = function() {
            initESW(null);
        };
        document.body.appendChild(s);
    } else {
        initESW('https://service.force.com');
    }
</script>

Best Answer

I've tried this, and It seems you don't have the

<apex:page> <!-- your chat code-- > </apex:page>

Please, make sure about this points:

  1. Check if you have enabled the custom domain after or before generating the chat deplyoment.
  2. Check if you haven't delete or modify any queue or buttom implementation on the administration section.

Hope it works.