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
Iman NazarianIman Nazarian 

How does setcustomvariable() work?

Hi everyone,

I am currently setting up Live Agent and want to trigger the automatic chat pop-up using custom variables stored in the websites source code. I wanted to ask if someone could explain to me how the setcustomvariable() deployment API works, possibly with an example? Please don't just send me the link to the developer's site as it does not clearly explain how to use the code....
Iman NazarianIman Nazarian
To give more information around this:

The automatic chat invitation code will be hosted on a non-salesforce website. When we are setting up Live Agent, we have 5 criteria to trigger a chat invitation to the customer:
Seconds on Pages
Seconds on Site
Number of Page Views
URL Match
Custom Variable

I am trying to use custom variables stored on the website to trigger a chat invitation. For example, if there is a variable on the website called "Customer Status" and the possible values are "Beginner, Intermediate, Expert" I want to set up a rule that says if "Customer Status equals Expert", then trigger the chat invite. From what I have read, I have to use the setcustomvariable() deployment code. Is that correct? If so, how do I use it? If not, how can I achieve this task?