Example: Tracking page views on a single page website (SPA)

Inject logging events on all links in the top navigation:

var triggerbeeCustom = triggerbeeCustom || (function () {
function init() {
  // Custom logging
  $('.navbar-nav li a').click(function () {
function logEvent($element)
  var url = '/' + $element.attr('href');
  url = url.replace(/#/,"");
  var title = $element.text();
  mtr.log(url, title);
init(); // Init on load
return {;}})();
Did this answer your question? Thanks for the feedback! Please reach out to [email protected] if there's anything you'd like to add. There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us