- How pushes combine
- What you can push
- Identify: prefill and hide fields
- Single page applications
- Related articles
Your page controls the Widget through one array, hdwDataLayer. You push settings, commands and event handlers into it from your own script, from Google Tag Manager or from any other tag manager. A push works at any moment, before or after the Widget script has loaded.
window.hdwDataLayer = window.hdwDataLayer || [];
hdwDataLayer.push({ color: '#2a6df4', title: 'How can we help?' });
The Widget decides nothing about who sees what: your page decides and pushes. This is why the same Widget can show different help to different pages, campaigns and customers.
How pushes combine
- Pushes merge in order. Objects merge by key, lists and plain values replace, and
nulldeletes a key. - After the Widget has started, a push applies at once when the panel is closed. When the panel is open it applies when the visitor closes it, so typed text is never lost.
- Commands (
teaser,open) are one-shot: they act and are not kept as settings. - The older
RedmineHelpdeskWidget.config({...})still works and is the same ashdwDataLayer.push({...}).
What you can push
Look (color, title, position, classes, theme), texts (translation), content for the page (articles, suggestedQuestions, aiSources), the form (identify), tabs (ask, contact, articles set to false, hide), remember, the event function onEvent and the commands teaser and open. Every key with its type and meaning is in the Widget API reference. A hidden tab is only a choice of the interface: the server keeps all its own checks.
Identify: prefill and hide fields
identify fills the form and removes the filled fields from the visitor's view.
The fields you can fill are listed in the Widget API reference.
hdwDataLayer.push({
identify: {
nameValue: 'Anna Smith',
emailValue: 'anna@example.com',
projectIdentifier: 'support',
trackerValue: 'Question'
}
});
- Every prefilled field is hidden. A field you want to show the visitor stays out of
identify. - An unknown project or tracker is ignored.
- Name and email travel to the form by a browser message, not in the address, so they stay out of server logs. The other values stay in the address.
- Everything the page sends is a hint. The ticket is always created by the anonymous user, and the server checks the project, the tracker and the allowed custom fields again, so a visitor cannot use the form to impersonate an employee.
For custom fields, page and campaign values, see Page, campaign and hidden fields on a ticket.
Single page applications
Push again on every route change. A configuration change reloads the form when the panel is closed and waits until it is closed otherwise; a Teaser or an open command acts at once.