    console.log('updated snippet code');
    var initESW = function(gslbBaseURL) {
      console.log('Loaded Text');
      embedded_svc.settings.displayHelpButton = false; //Or false
      embedded_svc.settings.language = 'en'; //For example, enter 'en' or 'en-US'
      

      //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)
      var buttonId = '57341000000DAhN';//This is Fallback Button Id
      var primaryButtonId = '57341000000DAhN'; 
      embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
         return '57341000000DAhN';
      };
      embedded_svc.settings.fallbackRouting = [primaryButtonId,buttonId]; //An array of button IDs, user IDs, or userId_buttonId

    //LiveChatTranscriptStatus contains the API call code to know the status of LiveChatTranscript
	var LiveChatTranscriptStatus_Script = document.createElement('script');
	LiveChatTranscriptStatus_Script.src = 'https://clarivatecommunities.force.com/resource/LiveChatTranscriptStatus';
	document.head.appendChild(LiveChatTranscriptStatus_Script);      
  
      embedded_svc.settings.enabledFeatures = ['LiveAgent'];
      embedded_svc.settings.entryFeature = 'LiveAgent';
      embedded_svc.settings.extraPrechatFormDetails = 
        [
            {
                "label": "Job Function",
                "value": "Academic - Researcher",
                "displayToAgent": false
            }, 
            {
                "label": "Account Status",
                "value": "Active",
                "displayToAgent": false
            }
        ];
        
        embedded_svc.settings.extraPrechatInfo = 
        [
            {
                "entityName": "Account",
                "showOnCreate": true,
                "linkToEntityName": "Case",
                "linkToEntityField": "AccountId",
                "linkToEntityName": "Contact",
                "linkToEntityField": "AccountId",
                "saveToTranscript": "AccountId",
                "entityFieldMaps": 
                [
                    {
                    "isExactMatch": false,
                    "fieldName": "Name",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Account Name 2"
                    },
                    {
                    "isExactMatch": true,
                    "fieldName": "SicDesc",
                    "doCreate": true,
                    "doFind": true,
                    "label": "Email"
                    },
                    {
                    "isExactMatch": false,
                    "fieldName": "RecordTypeId",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Account Record Type"
                    },
                    {
                    "isExactMatch": false,
                    "fieldName": "CA_Account_Status__c",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Account Status"
                    }
                ]
            },
            {
                "entityName": "Contact",
                "showOnCreate": true,
                "linkToEntityName": "Case",
                "linkToEntityField": "ContactId",
                "saveToTranscript": "ContactId",
                "entityFieldMaps": 
                [
                    {
                    "isExactMatch": false,
                    "fieldName": "FirstName",
                    "doCreate": true,
                    "doFind": false,
                    "label": "First Name"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "LastName",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Last Name"
                    }, 
                    {
                    "isExactMatch": true,
                    "fieldName": "Email",
                    "doCreate": true,
                    "doFind": true,
                    "label": "Email"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "Phone",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Phone"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "CA_Job_Function__c",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Job Function"
                    }
                ]
            },
            {
                "entityName": "Case",
                "showOnCreate": true,
                "linkToEntityName": "Account",
                "linkToEntityField": "CaseId",
                "saveToTranscript": "CaseId",
                "entityFieldMaps": 
                [
                    {
                    "isExactMatch": false,
                    "fieldName": "Description",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Question"
                    }, 
                    {
                    "isExactMatch": true,
                    "fieldName": "CaseNumber",
                    "doCreate": false,
                    "doFind": true,
                    "label": "Case Number 2"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "SuppliedCompany",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Web Company"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "SuppliedEmail",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Email"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "SuppliedPhone",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Phone"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "CA_Webform_First_Name__c",
                    "doCreate": true,
                    "doFind": false,
                    "label": "First Name"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "CA_Webform_Last_Name__c",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Last Name"
                    }, 
                    {
                    "isExactMatch": false,
                    "fieldName": "CA_Web_Country__c",
                    "doCreate": true,
                    "doFind": false,
                    "label": "Web Country"
                    }
                ]
            }
        ];
        embedded_svc.init(
			'https://clarivateanalytics.my.salesforce.com',
			'https://clarivatecommunities.force.com',
			gslbBaseURL,
			'00D41000001O1D5',
			'Compumark',
			{
				baseLiveAgentContentURL: 'https://c.la1-c1cs-ord.salesforceliveagent.com/content',
				deploymentId: '57241000000D6r3',
				buttonId: '57341000000DAhN',
				baseLiveAgentURL: 'https://d.la1-c1cs-ord.salesforceliveagent.com/chat',
				eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I2D0000008ObVUAU_17685e8972a',
				isOfflineSupportEnabled: false
			}
		);
	};

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