Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

On-site feedback

Feedback properties

Configuration

You can configure the on-site feedback properties as described below.

Property
Type
Description
Default value

delay

Number

Time delay, in milliseconds, to show the feedback tab on a page.

null

defaultRender

Boolean

If set to false, the feedback tab is not displayed by default.

true

customData

Object

Specify your custom data for feedback here in JSON format to submit along with every feedback that gets submitted. If not set then webengage.customData is referred.

null

formData

Array of Object

Specify values in the feedback form for pre-population of the fields. This is illustrated in the examples below.

null

alignment

String

Shows the feedback tab on the left/right side of the webpage. The possible value that you can specify here is left or right.

As specified in feedback tab configuration on dashboard.

borderColor

String

Renders feedback tab with the specified border color.

As specified in feedback tab configuration on dashboard.

backgroundColor

String

Renders feedback tab with the specified background color.

As specified in feedback tab configuration on dashboard.

defaultCategory

String

Shows the feedback form based on the feedback category specified here.

As specified in feedback tab configuration on dashboard.

showAllCategories

Boolean

If set to true, the feedback form appears with feedback category dropdown menu to let the end users submit contextual feedbacks. If set to false, the feedback form appears based on the default feedback category specified without any feedback category dropdown menu.

true

showForm

Boolean

If set to true, feedback form slides out on page load by default.

false

formData Object

Property
Type
Description

name

String

Label of the field in the feedback form which you want to pre-populate with data, or want to hide, or make it mandatory.

value

String

Specify the value of the field.

mode

String

Specify if the field should be hidden, read-only or default (no-change). Supported values are hidden, readOnly and default.

isMandatory

Boolean

Specify if the field should be mandatory or not.

options

Array of String

Applicable only in case of ‘Category’ field. Specify in case you want to show specific values in the category dropdown.

Usage examples

  1. Align feedback tab to the right
webengage.feedback.options('alignment', 'right');
  1. Set feedback tab background and border colours
webengage.feedback.options({
	'backgroundColor' : '#ff9',
	'borderColor' : '#f99'
});
  1. Pre-populate email field and keep it read-only, hide message and specific options for category drop-down
// Values in the category drop-down 'Like' & 'Question'

webengage.feedback.options('formData', [
	{
		'name' : 'email',
		'value' : '_EMAIL_VALUE_',
		'mode' : 'readOnly'
	}, {
		'name' : 'message',
		'mode' : 'hidden'
	}, {
		'name' : 'category',
		'isMandatory' : false,
		'value' : 'like',
		'options' : ['Like', 'Question'] // make sure you send right category lables
	}
]);

Feedback methods

webengage.feedback.render()

This method allows you to override feedback settings as configured on WebEngage dashboard. It also overrides any provided global configuration properties on the page. This method accepts all feedback configuration properties.

Usage examples

  1. Show a feedback on click of a button
webengage.onReady(function(){
	document.getElementById("_BUTTON_ID_").onclick = function () {
		webengage.feedback.render({ 'showForm' : true });
	};
});

webengage.feedback.clear()

This method clears any rendered feedback.

Usage example

  1. Clear a feedback on click of a button
document.getElementById("_BUTTON_ID_").onclick = function () {
	webengage.feedback.clear();
};

What's Next

Web push

On-site feedback