This route works similarly as a BaseRoute,
to reach a route match must be defined additional function and this function must return
Most commonly is used to form submission check, when the URL does not change, only confirmation message is printed.
Such action cannot be set as Google Analytics goal. In that case Base route with additional condition enables checking
if success message in displayed and enables change a tracked URL from
after submitting the form. And this URL can be set as a goal in Google Analytics.
It is needed to create a route and pass to object
Following code solves a problem described above:
This route tracks pageview afrer DOM ready event.
Constructor has four parameters, first, second and third are required.
&. These parts are parsed and used as substring of replaced URL.
trueif URL should be matched,
falseotherwise. Route is matched only is matched "original URL" and "condition function" returns
_trackPageview. Function is executed only once even if more trackers are created.
User is on page with URL
/contact. Ahter he or she sends a form,
a confirm message is displayed, but an URL does not change. To set a form submit
as a goal in Google Analytics we change an URL to