• Help
  • FAQs
  • Extending The Widget For Lead Routing

Extending The Widget For Lead Routing

  • Written by
  • Updated: May 5th 2018

The askavenue Chat Widget includes additional options to allow your chat widget to not only load on every page on your website, but to customize it so only specific Agents or where only a single Agent can receive chats.

To send a chat to a specific agent, a value must be passed to options.agent_id in the widget code. This ID can be imported when inviting agents to your account. Alternatively, our system will generate an ID for each agent if one is not supplied. The Agent ID must then be passed in your widget code on the page(s) you want to chats sent to that agent.
eg. options.agent_id='[your agent id]’

Those options can be extended by passing custom parameters in the Javascript code.

A sample Javascript Widget Code block looks like this.

<!-- start of AskAvenue script -->
<script type="text/javascript">
var options = {};
options.brokerage_uuid = "[unique-id]";
options.agent_id = '';
options.max_agents = '';
options.radius_limit = '';
options.latitude = '';
options.longitude = '';
window.scope = {};
window.scope.avenueValues = options;
var d = document;
var w = window;
var url = "https://app.askavenue.com/"
function avenueWidget() {
var h = d.getElementsByTagName('head')[0];
var css = document.createElement('style');
css.type = 'text/css';
css.id = 'ask_avenue_widget_st_content';
var styles = '@media only screen and (max-device-width: 667px), screen and (max-width: 450px) {iframe#avavenue-frame {right: 0px !important;bottom:0px !important; width: 100% !important}}iframe#avavenue-frame {position: fixed;right: 0px;bottom:0px;border: none; height: 420px; width: 360px;z-index: 2147483647;}';
if (css.styleSheet) css.styleSheet.cssText = styles;
else css.appendChild(d.createTextNode(styles));
var s = d.createElement('script');
s.type = 'text/javascript';
s.async = false;
s.src = url + 'assets/brokerage_widget/avenue_widget_content.js';
// var x = d.getElementsByTagName('head')[0];
if (w.addEventListener)
w.addEventListener("load", avenueWidget, false);
else if (w.attachEvent)
w.attachEvent("onload", avenueWidget);
else w.onload = avenueWidget;
<!-- /end of AskAvenue script -->



Name Default Description
brokerage_uuid Assigned This is your unique identifier assigned to you by Ask Avenue. If set, all active Agents added to your Account will receive a question.
agent_id Blank This is the Agent’s unique identifier (ID). If set, only the Agent with the specified ID will receive the broadcast question. This is used for direct agent messaging and bypasses all other broadcast rules. Note: all other options are ignored if this value is set. Only letters and numbers are accepted.
max_agents Blank This is the maximum number (quantity) of Agents who will receive a broadcast question. If set and agent_id is blank, only the entered quantity will receive the question. If left blank, all Active Agents in the Company will receive the question. If set, must be greater than 0.
radius_limit Blank This is the distance the question will broadcast to in Kilometers. If set, the question is broadcast to the set distance in kilometers from [latitude] and [longitude] values defined. For example, if set to 5 then the question will broadcast to all Agents in the Company within 5 kms of[latitude] and [longitude]. This is ignored if latitude and latitude are not set. If set, must be between 1 and 500.
latitude Blank This is the latitude coordinate based on where the question will broadcast to. Required if radius_limit is set. This is ignored if radius_limit is not set. If set, must be between -90 and 90.
longitude Blank This is the longitude coordinate based on where the question will broadcast to. Required if radius_limit is set. This is ignored if radius_limit is not set.  If set, must be between -180 and 180.


FAQs , Developer Docs
1 Star2 Stars (No Ratings Yet)