Skip to content

Troubleshoot JavaScript SDK

Something not working as expected? Our support team is happy to help you with your installation and any troubleshooting. Just contact us.

The steps below help you narrow down the cause and show you what information to send us, so we can help you faster.

Before you dig into the details, figure out which kind of problem you’re dealing with:

  • Other surveys display as expected. Your JavaScript SDK is most likely installed correctly, so the problem is probably with one specific survey. Contact our support team and send a link to the survey editor along with the ID of a user who should have seen the survey.
  • No surveys display, or user data isn’t tracked correctly. The problem is most likely with your SDK installation. See Debug Mode below.

Our JavaScript SDK has a built-in Debug Mode that helps you track down issues with your Refiner installation. When it’s active, an information panel in the top left corner of your browser shows the current state of your installation, and detailed logs are written to your browser’s developer console.

The simplest way to enable Debug Mode is to run the following method:

_refiner('enableDebugMode');

You can run this method either in your app code or in the developer console of your browser.

Once enabled, Debug Mode stays active in your current browser until you disable it. This is helpful when you debug things that happen on page load, for example page load triggers.

To disable Debug Mode, run:

_refiner('disableDebugMode');

If you can’t access the source code of your app or the developer console of your browser, you can use a URL parameter instead. Add #refiner_debug=true or ?refiner_debug=true to the URL of your web application and reload the page:

https://your-app.com#refiner_debug=true
https://your-app.com?refiner_debug=true

To turn Debug Mode off again, use refiner_debug=false the same way:

https://your-app.com#refiner_debug=false
https://your-app.com?refiner_debug=false

When Debug Mode is enabled, an information panel appears in the top left corner of your browser window.

The panel shows whether our SDK is installed correctly, whether you’re identifying your users, and whether there are any communication issues with our servers.

If the panel doesn’t appear, reload the page. If it still doesn’t appear, our SDK most likely isn’t loaded on your page. To check, open the developer console of your browser and search the page’s HTML for “refiner”. If the search doesn’t return any results, the SDK hasn’t been added to your page.

Besides showing the Debug Panel, Debug Mode also writes detailed logs to your browser’s developer console.

To open the developer console in Google Chrome, press “Option + ⌘ + J” on macOS or “Shift + Ctrl + J” on Windows and Linux.

In Firefox, press “Cmd + Opt + I” on macOS, or “Ctrl + Shift + I” or F12 on Windows and Linux.

Once it’s open, go to the “Console” tab. You’ll see detailed logs of all important events and data exchanged with our servers.

When you reach out to our support team, send us these debug logs (a screenshot works great). They’re one of the quickest ways for us to see what’s going on.

Our JavaScript SDK uses your browser’s local storage to reduce the amount of data exchanged between the browser and our servers. For example, it stores a hash value to remember that a specific identifyUser call was already sent, so it doesn’t send it again.

Data left over from earlier tests can make the SDK behave differently from what you expect. To rule this out, we recommend always testing Refiner in a newly opened incognito window.

Sooner or later, you’ll want to test a survey again that you’ve already completed or dismissed. The easiest way to do this is to delete the data linked to your test user and start with a blank slate. You have two options:

  1. Delete your test user. Find your test user in the user list in your Refiner dashboard, for example by searching for their ID or email, then select and delete it. Deleting a user profile also deletes all survey responses linked to it.
  2. Purge all user data. Go to SETTINGS > ATTRIBUTES and click “Purge User Data”. This removes all contact data in your Refiner project, including survey responses.

In both cases, open a new incognito window before you continue testing. This makes sure no old user data is still stored in your browser.