URL Parameters
Change an Idea Widget's language, pre-filled fields, screens and appearance with URL parameters or JavaScript settings.
You can change how an Idea Widget looks and behaves with URL parameters or JavaScript settings. That lets you reuse one widget across websites, languages and use cases, without creating a widget for each variation.
A parameter overrides the widget's saved configuration when the widget loads.
Choose how to pass parameters
How you pass parameters depends on the widget type.
Full-page widget
Add the parameters to the widget URL.
Full-page widget URL
https://idea-widget.ideanote.io/idea-submission?config=YOUR_CONFIG_ID&preferences.lang=enInline widget
Add the parameters to the src attribute of the iframe.
Inline widget
<iframe
title="Idea Collection Widget"
style="border: none; width: 100%; height: 400px;"
src="https://idea-widget.ideanote.io?config=YOUR_CONFIG_ID&preferences.lang=en"
allowfullscreen>
</iframe>Popover widget
Set window.ideanoteSettings as a nested object before the widget script loads. The script creates the iframe and turns your settings into URL parameters.
Popover widget
<script>
window.ideanoteSettings = {
config: "YOUR_CONFIG_ID",
preferences: {
lang: "en"
}
};
</script>
<script
async
src="https://static.ideanote.io/widget/widget.js">
</script>Set the widget language
Use preferences.lang to set the language of the widget.
Language | Parameter |
|---|---|
English |
|
Danish |
|
German |
|
French |
|
Swedish |
|
Spanish |
|
The visitor's browser language |
|
For example, these two links open the same widget in English and in Danish:
English
https://idea-widget.ideanote.io/idea-submission?config=YOUR_CONFIG_ID&preferences.lang=enDanish
https://idea-widget.ideanote.io/idea-submission?config=YOUR_CONFIG_ID&preferences.lang=daWithout the parameter, the widget uses its saved language setting, which starts as the workspace language.
If your widget uses custom translation variables, make sure they are translated into each language you link to.
Pre-fill form fields
Use preferences.defaultValues to pre-fill fields in the idea form. You can pass context such as a product name, the page address, a reference number or a suggested description.
The value is an object with field IDs as keys and the default values as values.
In a Popover widget
Popover widget with default values
window.ideanoteSettings = {
config: "YOUR_CONFIG_ID",
preferences: {
lang: "en",
defaultValues: {
"YOUR_FIELD_ID": "Suggested value",
"ANOTHER_FIELD_ID": "Another value"
}
}
};In a URL
For Full-page and Inline widgets, turn the object into JSON and URL-encode it.
Build the URL
const defaultValues = {
"YOUR_FIELD_ID": "Suggested value"
};
const url =
"https://idea-widget.ideanote.io?config=YOUR_CONFIG_ID" +
"&preferences.defaultValues=" +
encodeURIComponent(JSON.stringify(defaultValues));The result looks like this:
URL with default values
https://idea-widget.ideanote.io?config=YOUR_CONFIG_ID&preferences.defaultValues=%7B%22YOUR_FIELD_ID%22%3A%22Suggested%20value%22%7DExample: Collect feedback on a web page
This Inline widget pre-fills two fields: one with the path of the current page, and one with the start of a description that names the page.
Website feedback widget
<iframe
id="feedback-widget"
title="Website Feedback"
style="border: none; width: 100%; height: 300px;">
</iframe>
<script>
const defaultValues = {
"YOUR_URL_FIELD_ID": window.location.pathname,
"YOUR_DESCRIPTION_FIELD_ID":
'You could improve the article "' +
document.title + '" by '
};
const url =
"https://idea-widget.ideanote.io?config=YOUR_CONFIG_ID" +
"&preferences.lang=en" +
"&preferences.defaultValues=" +
encodeURIComponent(JSON.stringify(defaultValues));
document.getElementById("feedback-widget").src = url;
</script>Replace the configuration ID and the field IDs with your own.
All parameters
General
Parameter | Example value |
|---|---|
|
|
|
|
| URL-encoded JSON |
|
|
|
|
Welcome screen
Parameter | Example value |
|---|---|
|
|
| Share your feedback |
| Help us improve |
|
|
|
|
|
|
|
|
| Media reference |
| JSON array |
Form screen
Parameter | Example value |
|---|---|
|
|
|
|
Success screen
Parameter | Example value |
|---|---|
| Thank you |
| Your feedback has been received. |
|
|
|
|
|
|
|
|
|
|
| Media reference |
| JSON array |
Appearance
Parameter | Example value |
|---|---|
|
|
|
|
| Motion mode setting |
URL-encode text and special characters. For example, the # of a color code becomes %23.
Combine parameters
Join several parameters with &.
This link opens a Danish feedback widget that skips the Welcome screen, hides the form header and shows no confetti:
Combined parameters
https://idea-widget.ideanote.io/idea-submission?config=YOUR_CONFIG_ID&preferences.lang=da&preferences.entry.skip=true&preferences.submission.hideHeader=true&preferences.confirmation.graphics=noneThe same settings for a Popover widget:
Combined settings
window.ideanoteSettings = {
config: "YOUR_CONFIG_ID",
preferences: {
lang: "da",
entry: {
skip: true
},
submission: {
hideHeader: true
},
confirmation: {
graphics: "none"
}
}
};Supported language codes
en, cs-CZ, da, de, el, es, fi-FI, fr, fr-CA, hu-HU, it, nl, pt-BR, sk-SK, sv, zh-Hans, zh-Hant, vi, th, tr, ar, sl, no, pl
Use autodetect for the visitor's browser language.