You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2022/06/04 08:13:22 UTC

[apisix-website] branch master updated: feat: support matomo from the ASF (#1095)

This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
     new d83db275e80 feat: support matomo from the ASF (#1095)
d83db275e80 is described below

commit d83db275e806d449ce561a83a356ec1f3298dc0b
Author: 琚致远 <ju...@apache.org>
AuthorDate: Sat Jun 4 16:13:17 2022 +0800

    feat: support matomo from the ASF (#1095)
---
 website/config/ssrTemplate.js | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/website/config/ssrTemplate.js b/website/config/ssrTemplate.js
index 8d9ba56f575..07f6e3b7774 100644
--- a/website/config/ssrTemplate.js
+++ b/website/config/ssrTemplate.js
@@ -19,6 +19,25 @@ module.exports = {
       <% it.scripts.forEach((script) => { %>
         <link rel="preload" href="<%= it.baseUrl %><%= script %>" as="script">
       <% }); %>
+      <!-- Matomo from the ASF -->
+      <script>
+        var _paq = window._paq = window._paq || [];
+        /* tracker methods like "setCustomDimension" should be called before
+      "trackPageView" */
+        /* We explicitly disable cookie tracking to avoid privacy issues */
+        _paq.push(['disableCookies']);
+        _paq.push(['trackPageView']);
+        _paq.push(['enableLinkTracking']);
+        (function() {
+          var u="https://analytics.apache.org/";
+          _paq.push(['setTrackerUrl', u+'matomo.php']);
+          _paq.push(['setSiteId', '17']);
+          var d=document, g=d.createElement('script'),
+      s=d.getElementsByTagName('script')[0];
+          g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
+        })();
+      </script>
+      <!-- End Matomo Code -->
     </head>
     <body <%~ it.bodyAttributes %>>
       <%~ it.preBodyTags %>