--- a/busui/tripPlanner.php +++ b/busui/tripPlanner.php @@ -1,6 +1,6 @@ <?php include('common.inc.php'); - include_header("Trip Planner", true, true); + include_header("Trip Planner","tripPlanner", true, true); $from = (isset($_REQUEST['from']) ? filter_var($_REQUEST['from'],FILTER_SANITIZE_STRING) : "Brigalow"); $to = (isset($_REQUEST['to']) ? filter_var($_REQUEST['to'],FILTER_SANITIZE_STRING) : "Barry"); $date = (isset($_REQUEST['date']) ? filter_var($_REQUEST['date'],FILTER_SANITIZE_STRING) : date("m/d/Y")); @@ -98,6 +98,23 @@ $errorMessage .= urlencode($from) . " not found.<br>\n"; tripPlanForm($errorMessage); } else { + if (isMetricsOn()) { +// Create a new Instance of the tracker +$owa = new owa_php($config); +// Set the ID of the site being tracked +$owa->setSiteId('bus.lambdacomplex.org'); +// Create a new event object +$event = $owa->makeEvent(); +// Set the Event Type, in this case a "video_play" +$event->setEventType('view_trip_plan'); +// Set a property +$event->set('from',$from); +$event->set('to',$to); +$event->set('time',$time); +$event->set('date',$date); +// Track the event +$owa->trackEvent($event); + } $url = $otpAPIurl."ws/plan?date=" . urlencode($_REQUEST['date']) . "&time=" . urlencode($_REQUEST['time']) . "&mode=TRANSIT%2CWALK&optimize=QUICK&maxWalkDistance=840&wheelchair=false&toPlace=$toPlace&fromPlace=$fromPlace&intermediatePlaces="; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);