Chat Transcript object have several standard fields. For Example, Chat Button in Chat Transcript object stores the chat button id that the visitor clicked to initiate the chat.
Reference Link:
https://help.salesforce.com/articleView?id=live_agent_transcript_fields.htm&type=5
Reference Link:
https://help.salesforce.com/articleView?id=live_agent_transcript_fields.htm&type=5
To save the custom detail to a custom field on LiveChatTranscript at the end of a chat, use the below
liveagent.addCustomDetail().saveToTranscript()
Example:
liveagent.addCustomDetail( ‘Company’, ‘Acme’ ).saveToTranscript( ‘Company__c’ );
Here Company__c is a custom field in Chat Transcript Object.
Sample Code:
<script type=’text/javascript’>
var test = liveagent.addCustomDetail( ‘Example’, ‘Example Value’ ).saveToTranscript( ‘Source__c’ );
</script>
var test = liveagent.addCustomDetail( ‘Example’, ‘Example Value’ ).saveToTranscript( ‘Source__c’ );
</script>
Reference Link:
https://developer.salesforce.com/docs/atlas.en-us.live_agent_dev.meta/live_agent_dev/live_agent_deployment_api_code_sample.htm
To Pass values from Start Chat button to Pre-Chat Form, check the below
https://help.salesforce.com/articleView?id=000338336&type=1&mode=1