Tracking results when you have a website is key to success, as it will allow you to gather data about the performance of your website, and make sure that each parts is efficient.

Well your booking form is no different, and with Wappointment you are able to measure conversion with a bit of PHP and Javascript.

Track new bookings

Within your active’s theme functions.php, add the following code, making sure you replace the code between the two comments //START code and //END code. (you should put your Google Analytics or Google Tag tracking code here or any other script you want to use to track the event)

In this example, we are redirecting your user to a specific webpage and we display the information that is available to you within your browser’s console.

function my_wappo_analytics_appointment_confirmed()
{

  echo '<script>';
  echo "document.addEventListener('wappo_confirmed', function (e) {
              //START code
              window.location.replace('https://mysite.com/myurl');
              console.log('appointment Data', e.wdata )
              //END code
            }, false);";
  echo '</script>';
}
add_action('wp_print_footer_scripts', 'my_wappo_analytics_appointment_confirmed');

Track rescheduling event

Using a very similar example you can also track rescheduling events.

function my_wappo_analytics_appointment_rescheduled()
{

  echo '<script>';
  echo "document.addEventListener('wappo_rescheduled', function (e) {
              //START code 
              window.location.replace('https://mysite.com/myurl');
              console.log('appointment Data', e.wdata )
              //END code
            }, false);";
  echo '</script>';
}
add_action('wp_print_footer_scripts', 'my_wappo_analytics_appointment_rescheduled');

Ben
Ben
Ben takes care of all technical aspects of Wappointment. His ultimate goal, a 100% reliable solution that's just powerful enough to cover all of the possible needs for appointment scheduling.