Live customer support system Demo Signup Forums Downloads Contact

Add hidden fields

Guides, helps, etc

Moderator: Ace

Add hidden fields

Postby liveadmin » Fri Oct 08, 2010 1:57 am

Hidden fields in chat window are invisible by visitor and noticeable by agents. They can be used to send extra information to agents. Here are a few samples:

- Let agent know the page or page identifier of location the request is coming from
- Visitor's language according to your site
- You can put the chat button in a members only page, then let the agent know that visitor is a member, VIP or paid for some services etc.

and many more. To do that you will need to add a script block to your page and define the live_admin_extra_fields variable. General syntax is:


live_admin_extra_fields = [{definition},{definition},...];
where {definition} is {'name':'field name','value':'field value'}



For instance if you put the chat button in a members only page and want the agent to know visitor is coming from that page use:

Code: Select all
<script type="text/javascript">

live_admin_extra_fields = [{'name':'Coming from','value':'Members Area'}];

</script>


The above example will show something like this in admin panel:

Coming from: Members Area

and if you want a second field to get passed (for instance username) use:

Code: Select all
<script type="text/javascript">

live_admin_extra_fields = [
    {'name':'Coming from','value':'Members Area'},
    {'name':'Username','value':'--VALUE-OF-USERNAME--'}];

</script>


If you page is in PHP, you can easily pass PHP based variables, for instance if caller has authenticated into a page and you have the username is a session variable you can use:

Code: Select all
<script type="text/javascript">

live_admin_extra_fields = [
    {'name':'Coming from','value':'Members Area'},
    {'name':'Username','value':'<?=$_SESSION['username'];?>'}];

</script>



If you have multiple buttons on the same page separated by 'tag' ( see this) then you can send different data to each button using tags, here is an example:

Code: Select all
<script type="text/javascript">

live_admin_extra_fields = [
    {'name':'User Language','value':'English','tag':'liveadmin_1'},
    {'name':'User Language','value':'Spanish','tag':'liveadmin_2'},
    {'name':'Page','Home':'yes',}];

</script>


In above example, 'User Language: English' will be send to the chat button identified by 'liveadmin_1', 'User Language: Spanish' will be send to the chat button identified by 'liveadmin_2' and 'Page: Home' will be send to both of them.

This feature is available on LiveAdmin hosted version 1.3.4 and later and will be available on Standalone and Lite version 1.3.5.

Regards
Farhad Malekpour
liveadmin
 
Posts: 101
Joined: Sat Feb 28, 2009 8:30 pm

Return to Guides and FAQs

Who is online

Users browsing this forum: No registered users and 1 guest

cron