Skip to main content

How do I manage overriding widget and chat settings? - База знаний / Deskpro Legacy - Deskpro Support

WARNING: You're browsing documentation for an older version of Deskpro. For the most up-to-date version, see: Overriding Messenger Settings

How do I manage overriding widget and chat settings?

Authors list

All of the settings you find under Admin >  Chat > Site Widget & Chat can also be overridden on a per-page basis.

The default widget looks like this:

<!--DESKPRO_WIDGET_LOADER::BEGIN-->
<script type="text/javascript">window.DESKPRO_WIDGET_OPTIONS = {
"helpdeskUrl": "https://example.deskpro.com/"
};
</script>
<script type="text/javascript" id="dp-widget-loader" src="https://example.deskpro.com/dyn-assets/pub/build/widget_loader.min.js"></script>
<!--DESKPRO_WIDGET_LOADER::END-->

You can assign override values to window.DESKPRO_WIDGET_OPTIONS to change whatever value you have set in the Admin Interface.

<!--DESKPRO_WIDGET_LOADER::BEGIN-->
 <script type="text/javascript">window.DESKPRO_WIDGET_OPTIONS = {
   "helpdeskUrl": "https://example.deskpro.com/",
  "language": 1,
   "widget": {
     "type": "bubble",
     "position": "right",
     "enabled": true
   },
   "button": {
     "translations": [
       {
         "language": 1,
         "name": "Help"
       }
     ],
     "size": "medium",
     "colors": {
       "background": "#62ad8c",
       "text": "#ffffff"
     }
   },
   "chat": {
     "default_values": {
       "fields": {
         5: "my val",
         6: [7, 8]
        }
     },
     "enabled_custom_fields": [1, 4, 7],
     "request_user_info": true,
     "proactive": true,
     "popup": {
       "translations": [
         {
           "language": 1,
           "title": "Customer Support",
           "message": "Need help? Just reply to start a live chat with one of our team.",
           "heading": "Ask us a question!",
           "subheading": "Our team are online and ready to help with your enquiries. Send us a message to get started."
         }
       ],
       "style": "agent_text_button"
     },
     "begin_mode": "conversation",
     "allow_department_selection": false,
     "waiting_timeout": 150
   },
   "ticket": {
     "select_department": "custom",
     "default_department": null,
     "select_subject": "custom",
     "default_subject": "",
     "default_values": {
        "subject": "my subject",
        "department": 4,
        "message": "my message",
        "fields": {
          5: "my val",
          6: [7, 8]
        },
        "user_fields": {
          5: "my val",
          6: [7, 8]
        },
        "organization_fields": {
          5: "my val",
          6: [7, 8]
        }
     }
   } 
   };
 </script>
 <script type="text/javascript" id="dp-widget-loader" src="https://example.deskpro.com/dyn-assets/pub/build/widget_loader.min.js"></script>
 <!--DESKPRO_WIDGET_LOADER::END-->

 

root

helpdeskUrl - The URL to the helpdesk
language - The language to force. If you don't set a language, then Deskpro will use the language the user has from cookies (if any) or guess the users language.

widget

Basic widget options.

type - widget view type (column, bubble)
position - widget position location (left, right)
enabled - is widget enabled (true, false)

button

Widget button options.

translations - list of button word translations (language - Deskpro language id, name - button word translation text)
size - button size (small, medium, large)
colors - background and text colors for widget button and start chat popup (hex).

chat

Widget live chat options.

request_user_info - require user to provide its (name, email, department, custom fields) info before the chat starts
proactive - displays widget chat popup that encourages users to chat with you
popup - chat popup view type (agent_text_button, agents_button, text_button, widget_button_agent)
begin_mode - begin chat form view type (conversation, form)


allow_department_selection - displays department selectbox (true, false) - DEPRECIATED

select_department - allows user to select department (custom, default) - using the option  custom will allow the user to select their own department. The defaults option will preselt the department and hide the dropdown.
default_department - if select_department is default then you need to define a default Deskpro department id


waiting_timeout - timeout in seconds before ticket form link will be displayed Sorry! It’s taking longer than expected to find an agent to take your chat. Would you like to submit a ticket instead?

default_values - Set default values for chat form fields

ticket

Widget ticket form options.

select_department - allows user to select department (custom, default) - using the option  custom will allow the user to select their own department. The defaults option will preselt the department and hide the dropdown.
default_department - if select_department is default then you need to define a default Deskpro department id
select_subject - (custom - Ask user for a subject, message - select_subject, default - Set a subject)
default_values - Set default values for ticket form fields

Полезно Unhelpful

48 of 104 people found this page helpful

Добавить комментарий

Please log in or register to submit a comment.

Need a password reminder?