Differences

This shows you the differences between two versions of the page.

Link to this comparison view

test-mode [2012/10/17 11:02] (current)
admin created
Line 1: Line 1:
 +====== Running Tour My App in Test Mode ======
  
 +Tour My App can be run in test mode when you are testing your tours and integrations.
 +
 +In test mode:
 +
 +  * The tour runs will not be counted, so you will not be using up your monthly limit
 +  * Analytics will not be collected, so that the actions you do while testing will not get mixed up with the analytics collected in production
 +
 +Once you perform the integration, add this line just before ''tour.start()'' to enable test mode:
 +
 +   tour.setOptions({"test_mode": true});
 +
 +
 +===== Automatically switching between test and production modes =====
 +
 +Sometimes it is annoying to add the test mode line in development and staging servers and remove it in production server. And it is easy to forget to add or remove the line. So we highly recommend that you put a check around it to detect the server and enable test mode. Example:
 +
 +    if (window.location.href.indexOf("mysite.com") == -1) {
 +      // Not running on mysite.com (production server), so enable test mode
 +      tour.setOptions({"test_mode": true});
 +    }
 +
 +This way, the test mode will be disabled on production server and enabled otherwise