Skip to content

Commit

Permalink
keep only matomo tracking configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Oct 30, 2024
1 parent b6eeece commit 7e53efc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
4 changes: 2 additions & 2 deletions cds/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,8 +1228,8 @@ def _parse_env_bool(var_name, default=None):
THEME_ERROR_TEMPLATE = "cds_theme/error/base.html"
# Tracking template
THEME_TRACKINGCODE_TEMPLATE = "cds_theme/trackingcode.html"
# Piwik tracking code: set None to disabled it
THEME_PIWIK_ID = None
# Matomo tracking code: set None to disabled it
THEME_MATOMO_ID = None

###############################################################################
# Previewer
Expand Down
34 changes: 0 additions & 34 deletions cds/modules/theme/templates/cds_theme/trackingcode.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,3 @@
{%- if config.THEME_PIWIK_ID %}
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDomains", ["*.videos.cern.ch"]]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
var u =
("https:" == document.location.protocol ? "https" : "http") +
"://piwik.web.cern.ch/";
_paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(["setSiteId", "{{config.THEME_PIWIK_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.js";
s.parentNode.insertBefore(g, s);
})();
</script>
<noscript
><p>
<img
src="//piwik.web.cern.ch/piwik.php?idsite={{config.THEME_PIWIK_ID}}"
style="border: 0"
alt=""
/></p
></noscript>
<!-- End Piwik Code -->
{%- endif %}

<!-- Webanalytics -->
{%- if config.THEME_MATOMO_ID %}
<!-- Matomo -->
Expand Down

0 comments on commit 7e53efc

Please sign in to comment.