Embeddable Feedback Widget

A script widget that can be embedded into your site

How to install the widget?

1. Log in to your ProdCamp account. Go to the product details page of a product that you want to embed the widget in.

2. Go to the "Widget" tab

3. Click on the "Generate" button to generate the script code that you should insert to the end of the body element on your page.

After the system generates the script code - click on the text area and the code will be copied to your clipboard. Insert this code to the end of the <body> tag on your page.

4. Finally, you have to invoke the "ProdCamp" init function to identify a user in your system that will be matched to a Customer Contact in ProdCamp (you don't need to create a contact for every user - it will be created automatically based on the data you provide in the init function and when a user provides some feedback for the first time or matched to an existing one by email)

<script>
ProdCamp('initFeedbackWidget', {
company: {
name: 'Foo',
revenue: 100
},
firstName: 'John',
lastName: 'Doe',
});
</script>

Those are the fields that you can provide in the init function:

  • email

  • company

    • name

    • revenue

  • firstName

  • lastName

The "email" field is the only required one and will be used as an identifier to create a new contact or match the provided feedback to an existing one.

The "company" property will be used to identify a Customer Account that the contact belongs to (if a Customer Account with such name exists - contact will be bound to this account, in other cases, a new Customer Account will be created with the name that was provided in the "name" field of the company property). When you provide a revenue field - it will update the Revenue field inside the provided account if it exists or set the revenue value in the newly created one.

If the "company" property is not provided - contact will be created along with a new customer account that will have the name same as the domain of the email provided in the init function if the domain is not of commonly used email services like "Google," "Hotmail," etc. Or the new account will not be created, but the contact will be bound to the "No Account" special customer account that exists in your ProdCamp from the start and collects all the contacts that can't be identified by their emails.

Commands

There are several commands that you can use to manipulate the feedback widget behavior

  • initFeedbackWidget - this one you already know and it instantiates a feedback widget.

  • openFeedbackWidget - this command can be used to open the widget manually from anywhere in your code

  • closeFeedbackWidget - this command will respectively close the widget

  • updateFeedbackWidgetUser - using this command you can update the user that will be sent along with the next provided feedback. The format of the model that should be provided is the same as in the first init command. Just like the following code:

<script>
ProdCamp('updateFeedbackWidgetUser', {
company: {
name: 'Foo',
revenue: 100
},
firstName: 'John',
lastName: 'Doe',
});
</script>
  • destroyFeedbackWidget - destroy the widget instance on the page