Back to docs

Category: developer

Response URL when using a SPA

Because Freddy's script is unaware of URL changes when you're using a SPA, you can pass the response URL manually.

If you haven't already, please read the documentation article about setting options programmatically with show and setOptions here.

Important: value of URL

Always use the full URL as a value, like for instance window.location.href. This way they'll always be clickable. Not only in the dashboard, but also in Slack and email alerts.

Example when using the setOptions method

window.addEventListener('load', function() {
  freddyWidget.setOptions({
      url: 'your-url-string-here'
  });
});

Example when using the show method

document.getElementById('my-button').addEventListener('click', function() {
  freddyWidget.show({
      url: 'your-url-string-here'
  });
});

More options

This is the same way as custom fields are set, so everything in one go would look like:

document.getElementById('my-button').addEventListener('click', function() {
  freddyWidget.show({
      custom_fields: {
          user_id: 42,
          email: 'customer@example.com'
      },
      url: 'your-url-string-here'
  });
});

Start today

Collect feedback from your most valuable source: your visitors and customers.

Get started for free

Free 30 day trial • No credit card required

Subscribe to Freddy's updates

Get insights on how to best get feedback from your customers, updates on new features and maybe even a joke from Freddy.