/** * Get the custom URL of the Tracking Code * * @return string URL */ protected function getCustomUrl() { $path = $this->request->getUri()->getPath(); $routeMatch = $this->router->match($this->request); if ($routeMatch && $routeMatch->getMatchedRouteName() == 'vufindrecord-ajaxtab') { // Replace 'AjaxTab' with tab name in record page URLs $replace = 'AjaxTab'; $tab = $this->request->getPost('tab'); if (null !== ($pos = strrpos($path, $replace))) { $path = substr_replace($path, $tab, $pos, $pos + strlen($replace)); } } return $path; }