feat(demo): add Google analytics to the demo

This will allow testing customization assets feature
This commit is contained in:
Łukasz Mierzwa
2018-10-29 21:38:35 +00:00
parent 8d0b8037c6
commit c35e4256ce
3 changed files with 26 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ COPY demo/alertmanager.yaml /etc/alertmanager.yaml
COPY demo/generator.py /generator.py
COPY --from=go-builder /go/src/github.com/prymitive/karma/karma /karma
COPY demo/karma.yaml /etc/karma.yaml
COPY demo/custom.js /custom.js
RUN adduser -D karma
USER karma
CMD supervisord --nodaemon --configuration /etc/supervisord.conf

23
demo/custom.js Normal file
View File

@@ -0,0 +1,23 @@
// https://developers.google.com/analytics/devguides/collection/analyticsjs/
(function(i, s, o, g, r, a, m) {
i["GoogleAnalyticsObject"] = r;
(i[r] =
i[r] ||
function() {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(
window,
document,
"script",
"https://www.google-analytics.com/analytics.js",
"ga"
);
ga("create", "UA-128338979-1", "auto");
ga("send", "pageview");

View File

@@ -8,6 +8,8 @@ alertmanager:
annotations:
hidden:
- help
custom:
js: /custom.js
filters:
default:
- "@receiver=by-cluster-service"