Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article, we explained how you could check the deployment conditions on your website. We also explained how you can debug your script if your survey did not show as you had expected. In the following article, we will elaborate more on the deployment conditions and the reasons why these conditions can show a false - value in your console.

Step 1: Deployment Targeting

Go to ‘Data collection’ > ‘Deployments’. Click on the pencil button of the deployment you want to edit. Drag the form you want to use to the centre and go to ‘Targeting’.

...

Step 2: Developer tools

Open the developer tools on your website, by clicking on the icon with three dots, in the top right corner, then, ‘More tools’ > ‘Developer tools’.

...

Step 3: Console tab

Go to the console tab, and type the following in the command line: document.cookie='LOG=true'. Refresh your page. You will see a page with ‘P>’ on each line.

Step 4: True/False values

If you have all toggles switched off in your deployment, except for ‘Append div to body of the page if not found’, you should only see ‘true’-values in the console of the development tools. You should also see ‘triggered!’ on the last line of your console. Remember, if you have recently made changes to your form, your previous version is still saved in your cache and cookies. See this article for more information.

...

If you want to switch on one of the toggles in the deployment, your console could show a false-value for that condition.

Example 1

Say, you only want to show your form to 10% of your users. Switch on the toggle ‘Show only to a percentage of users’, and enter the value 10 as your percentage. Save the deployment by clicking on the green save button in the top right corner. Now, go back to the developer tools on your website. Since you have changed the deployment, you first need to delete your cookies. See this article on how to do this.

Once your cookies are deleted, go back to the ‘Console’ tab, and click on refresh. You will see a line with ‘passive condition set’ and a random number. If this random number is smaller than your percentage, it will return the value true. If this random number is larger than your percentage, it will return the value false. You will only see this line the first time you refresh the page. In this case, 79.5 is the random number, which is larger than 10, so it will return a false value. If all is done well, and you got a false-value, you should not see ‘triggered!’ on the last line anymore, instead, you should see ‘not all OK…’ on the second to last line.

...


If you now reload the page, this rule should be evaluated as true.

...

Example 2

It is also possible to add a condition based on a URL. In your deployment, switch on the toggle for ‘Show based on URL conditions’. Add two URLs by clicking on ‘(+) AND’: 

...

You should now see a true-value, if you are indeed on one of the specified URLs, for location in your console:

...

Example 3

Let’s say you only want to show your form on a specific date. Turn this toggle on, and set your condition. In this example, we will use: 

...


You can also set several conditions to for your deployment.