Widget JavaScript Options
Configuration
Options
The following options can be added to your Widget settings in order to identify users and segment posts.
Option
| Type
| Required
| Description
|
workspace_id
| String
| Required
| The id of the Workspace that the widget belongs to.
|
name
| String
| Optional
| The user's name. When this is present it's used to identify users when they leave feedback or emoji reactions.
|
email
| String
| Optional
| The user's email address. When this is present it's used to identify users when they leave feedback or emoji reactions.
|
segment
| Object
| Optional
| Segment options used to control post segmentation. Read more here. All options configured within this object should be defined as Strings. |
auto_init
| Boolean
| Optional
| Defaults to true if not provided. If set to false, the widget will not auto-initialize, and you will need to call Productstash.init() in order to initialize the widget.
|
Example
Here's an example of the code snippet populated with a customer's details as well as some segment options:
var ps_config = {
workspace_id: "123456789",
auto_init: true,
name: "Alex Smith",
email: "alex@productstash.io",
segment: {
plan: "pro",
onboarded: "true",
}
}
Functions
The Productstash widget has a number of available functions that can be called manually to perform various behaviours. This is an ever-growing list, check back regularly for new operations, or
request new features.
Option
| Description
|
Productstash.show()
| Opens the Widget.
|
Productstash.hide()
| Closes the Widget.
|
Productstash.init()
| Initializes the widget, if auto_init is set to false. |
Related Articles
User Segmentation
What is User Segmentation? User segmentation is a powerful tool used in marketing to target specific groups of customers. While it sounds like a fancy term, user segmentation is simply the dividing of users based on specific factors into different ...
Configuring your Widget
What is the Widget? The Updates Widget is a stream of your latest update posts which can be embedded within your website in the form of a pop-out side bar. Here you can see ours in action: Customisation options The Widget and its content can be ...
Adding a custom selector to trigger the widget
Overview The Productstash widget can be configured to display in a number of different ways. The following display scenarios are supported: Default floating icon only Default floating icon only, but with a custom icon Default floating icon + Custom ...
Adding Quick Links to your Widget
What are quick links? The Updates Widget can include up to 5 custom quick links that appear at the top of the widget. Here's our example, which currently has 4 added: All quick links open the link within a new tab, rather than within the embedded ...