Fix Piwik URL

* closes #49
This commit is contained in:
Nicola Tarocco 2020-12-07 21:50:52 +01:00
parent 7be99d9494
commit a8f8b94414
2 changed files with 26 additions and 24 deletions

View file

@ -61,8 +61,8 @@ The https://cern.ch/cara application is running on CERN's OpenShift platform. In
### Updating the test-cara.web.cern.ch instance ### Updating the test-cara.web.cern.ch instance
We have a replica of https://cara.web.cern.ch running on http://test-cara.web.cern.ch. Its purpose is to simulate what will happen when We have a replica of https://cara.web.cern.ch running on http://test-cara.web.cern.ch. Its purpose is to simulate what will happen when
a feature is merged. To push your changes to test-cara, simply push your branch to live/test-cara and the CI pipeline will trigger the a feature is merged. To push your changes to test-cara, simply push your branch to `live/test-cara` and the CI pipeline will trigger the
deployment. To push a to this branch, there is a good chance you will need to force push - you should always force push with care and deployment. To push to this branch, there is a good chance that you will need to force push - you should always force push with care and
understanding why you are doing it. Syntactically, it will looks something like (assuming that you have "upstream" as your remote name, understanding why you are doing it. Syntactically, it will looks something like (assuming that you have "upstream" as your remote name,
but it may be origin if you haven't configured it differently): but it may be origin if you haven't configured it differently):

View file

@ -1,37 +1,39 @@
if (document.location.hostname == "test-cara.web.cern.ch") { if (document.location.hostname == "test-cara.web.cern.ch") {
var _paq = _paq || []; var _paq = _paq || [];
_paq.push(['trackPageView']); _paq.push(["trackPageView"]);
_paq.push(['enableLinkTracking']); _paq.push(["enableLinkTracking"]);
(function () { (function () {
var u = "//piwikui.web.cern.ch/piwikui/"; var u = "//piwik.web.cern.ch/";
_paq.push(['setTrackerUrl', u + 'piwik.php']); _paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(['setSiteId', '7615']); _paq.push(["setSiteId", "7615"]);
var d = document, var d = document,
g = d.createElement('script'), g = d.createElement("script"),
s = d.getElementsByTagName('script')[0]; s = d.getElementsByTagName("script")[0];
g.type = 'text/javascript'; g.type = "text/javascript";
g.async = true; g.async = true;
g.defer = true; g.defer = true;
g.src = u + 'piwik.js'; g.src = u + "piwik.js";
s.parentNode.insertBefore(g, s); s.parentNode.insertBefore(g, s);
})(); })();
} else if (document.location.hostname == 'cara.web.cern.ch') { } else if (document.location.hostname == "cara.web.cern.ch") {
var _paq = _paq || []; var _paq = _paq || [];
_paq.push(['trackPageView']); _paq.push(["trackPageView"]);
_paq.push(['enableLinkTracking']); _paq.push(["enableLinkTracking"]);
(function () { (function () {
var u = "//piwikui.web.cern.ch/piwikui/"; var u = "//piwik.web.cern.ch/";
_paq.push(['setTrackerUrl', u + 'piwik.php']); _paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(['setSiteId', '7616']); _paq.push(["setSiteId", "7616"]);
var d = document, var d = document,
g = d.createElement('script'), g = d.createElement("script"),
s = d.getElementsByTagName('script')[0]; s = d.getElementsByTagName("script")[0];
g.type = 'text/javascript'; g.type = "text/javascript";
g.async = true; g.async = true;
g.defer = true; g.defer = true;
g.src = u + 'piwik.js'; g.src = u + "piwik.js";
s.parentNode.insertBefore(g, s); s.parentNode.insertBefore(g, s);
})(); })();
} else { } else {
console.log("Usage tracking disabled for hostname: " + document.location.hostname); console.log(
"Usage tracking disabled for hostname: " + document.location.hostname
);
} }