function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michael Hedrick 2Michael Hedrick 2 

Live Agent Deployment addCustomDetail

Hello I was wondering can I add the addCustomDetail method to the Live Agent deployment code?  The Chat button is on a Public website

So currently the code looks like this
<script type='text/javascript' src='https://c.la9cs.salesforceliveagent.com/content/g/deployment.js'></script> 
<script type='text/javascript'> 
liveagent.init('https://d.la9cs.salesforceliveagent.com/chat', '57290000000PC4m', '00DO00000007EgL'); 
</script>


We created a custom webpage(pop up) to ask the custom to opt in before initiating the Chat window.  If they opt in, the chat window will start and I need the opt in value(boolean) value to be passed to the Chat Transcript record which is attached to the Case record. 
o can I add the addCustomDetail method to the Live Agent deployment code?
<script type='text/javascript' src='https://c.la9cs.salesforceliveagent.com/content/g/deployment.js'></script> 
<script type='text/javascript'> 
liveagent.addCustomDetail('Opt In', '{True}').saveToTranscript('OptIn__c'); 
liveagent.init('https://d.la9cs.salesforceliveagent.com/chat', '57290000000PC4m', '00DO00000007EgL'); 
</script>

Thanks