Fix Google Analytics for HTML5 history code

This should stop the site from showing up as its own referrer.
This commit is contained in:
Cathy J. Fitzpatrick
2013-04-18 04:23:38 -06:00
parent 5261dc9478
commit c3a8b033ce

View File

@@ -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.
}