$(document)
		.ready(
				function() {
					/**
					 * Small screen
					 */
					$(document)
							.on(
									'click',
									'.navbar-collapse.in',
									function(e) {
										if ($(e.target).is('a')
												&& $(e.target).attr('class') != 'dropdown-toggle') {
											$(this).collapse('hide');
										}
									});

					/**
					 * On click, mark as active AND send Google Analytics information (Specific for #)
					 */
					$(".nav a").on("click", function() {
						$(".nav").find(".active").removeClass("active");
						$(this).parent().addClass("active");

						//Override Google Analytics page name
						//Using active anchor
						ga('set', 'page', '#' + $(this).attr('data-anchor'));
						ga('send', 'pageview');

					});
				});