Prefill fields with customer data

You can prefill forms on your app with customer data you already have. Makes it easier for your customers to fill in forms. There are two ways you can do this: by adding it to your JS snippet or via URL params. Which option you need depends on your use case. Usually the JS snippet option is useful for data of logged in users, while the URL params option can be useful to use outside of your app, eg. as a link in an email.

Auto-fill via your JS snippet

Your Helptail JS snippet accepts a properties: {} object where you can prefill customer data. To automatically work, the “keys” you enter need to match the labels of the form in camelCase. If that sounds complicated, let’s look at an example:

<script>
  //…
  mw('init', {
    publicKey: 'YOUR-PUBLIC-KEY',
    properties: {
      email: 'your-customer@example.com',
      yourName: 'J. Doe'
    }
  });
</script>

The snippet is shortened for brevity. View the full snippet here.

Now every Helptail form on your site with a “Email” field will be prefilled with “your-customer@example.com”. Every field labeled “Your Name” will be prefilled with “J. Doe”.

Ofcourse you probably want to dynamically add these values based on the current actual user.

Pro-tip: You can use custom properties for rules too. Check the docs how this works.

Auto-fill via URL params

To auto-fill forms via URL params, you can use the htProperties param key. Like so: https://helptail.com/survey/?htProperties=[name=Helptail,email=support@helptail.com].

The fields on that form will be auto-filled with the name (Helptail) and email (support@helptail.com).

Globally enable or disable all streams

If you want to enable (or disable) Helptail on certain pages or within an environment, you can set the enabled boolean. If set to “false” no stream will be loaded onto the page.

It is set as “true” by default.

<script>
  //…
  mw('init', {
    publicKey: 'YOUR-PUBLIC-KEY',
    enabled: false // or: true
  });
</script>

The snippet is shortened for brevity. View the full snippet here.