diff options
author | Jesse <jesse@orangecoding.com> | 2014-07-05 05:57:39 +0400 |
---|---|---|
committer | Jesse <jesse@orangecoding.com> | 2014-07-05 06:27:53 +0400 |
commit | d8d0594984b9b35a348173bc07600d588f72eb84 (patch) | |
tree | 7284ff91a9dfec115bee957d28c2c66bd778fc02 /misc/others | |
parent | 29243433e46d3cf29773d892465bb493b82e8fb7 (diff) |
Changed JavaScript Tracking Code generation to use "//", instead of verifying whether the site is using "https", or not, and generating a corresponding URL.
"//" has been part of the RFC for well over 18 years. It has been confirmed to work in all major browsers (Firefox, Chrome, IE, Opera).
References:
- RFC 1808 Section 4: http://www.ietf.org/rfc/rfc1808.txt
- RFC 3986 Section 5.2: http://www.ietf.org/rfc/rfc3986.txt
- Stack Overflow QA 1: http://stackoverflow.com/q/4659345/238722
- Stack Overflow QA 2: http://stackoverflow.com/q/6785442/238722
Diffstat (limited to 'misc/others')
-rw-r--r-- | misc/others/tracker_simpleImageTracker.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/others/tracker_simpleImageTracker.php b/misc/others/tracker_simpleImageTracker.php index 30f6c2b211..6bcaf21fd1 100644 --- a/misc/others/tracker_simpleImageTracker.php +++ b/misc/others/tracker_simpleImageTracker.php @@ -12,11 +12,11 @@ $trackingURL = Piwik_getUrlTrackPageView($idSite = 16, $customTitle = 'This titl <script type="text/javascript"> var _paq = _paq || []; (function() { - var u=(("https:" == document.location.protocol) ? "https" : "http") + "://localhost/piwik-master/"; + var u="//localhost/piwik-master/"; _paq.push(["setTrackerUrl", u+"piwik.php"]); _paq.push(["setSiteId", "16"]); - var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; - g.defer=true; g.async=true; g.src=u+"js/piwik.js"; s.parentNode.insertBefore(g,s); + var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; + g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Piwik Code --> |