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/proxy-hide-piwik-url | |
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/proxy-hide-piwik-url')
-rw-r--r-- | misc/proxy-hide-piwik-url/README.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/proxy-hide-piwik-url/README.md b/misc/proxy-hide-piwik-url/README.md index 016bbe1536..fcdf168c6e 100644 --- a/misc/proxy-hide-piwik-url/README.md +++ b/misc/proxy-hide-piwik-url/README.md @@ -29,11 +29,11 @@ To run this properly you will need ``` [...] (function() { - var u=(("https:" == document.location.protocol) ? "https" : "http") + "://trackedsite.com/"; + var u="//trackedsite.com/"; _paq.push(["setTrackerUrl", u+"piwik.php"]); _paq.push(["setSiteId", "trackedsite-id"]); - 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+"piwik.php"; 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.php"; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Piwik Code --> |