From c3a8b033ce0c9f8f9845f002db28cee281e4f416 Mon Sep 17 00:00:00 2001 From: "Cathy J. Fitzpatrick" Date: Thu, 18 Apr 2013 04:23:38 -0600 Subject: [PATCH] Fix Google Analytics for HTML5 history code This should stop the site from showing up as its own referrer. --- js/sim.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/sim.js b/js/sim.js index 80df1e1ab..f0f107e1c 100644 --- a/js/sim.js +++ b/js/sim.js @@ -2866,6 +2866,9 @@ if (window.history && history.pushState) { if (document.location.pathname !== Config.locPrefix + urlLoc) { try { history.pushState(null, null, Config.locPrefix + urlLoc); + if (_gaq) { + _gaq.push(['_trackPageview', Config.locPrefix + urlLoc]); + } } catch (e) { // Throws insecure operation when running on local filesystem. }