From 0aefb5c758b80054d75431ba6e2fed0b15dc831b Mon Sep 17 00:00:00 2001
From: Sebastian Frank <frank@basiskonfiguration.de>
Date: Thu, 21 Feb 2019 18:10:05 +0100
Subject: [PATCH] matomo tracking on website

---
 website/templates/base.html            | 25 +++++++++----------------
 website/templates/partials/matomo.html | 17 +++++++++++++++++
 2 files changed, 26 insertions(+), 16 deletions(-)
 create mode 100644 website/templates/partials/matomo.html

diff --git a/website/templates/base.html b/website/templates/base.html
index c7808e7..b4f8a1c 100755
--- a/website/templates/base.html
+++ b/website/templates/base.html
@@ -3,20 +3,19 @@
 <head>
 	<meta charset="utf-8">
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
-	
+
 	<!-- Favicon -->
 	<link rel="icon" href="project-files/img/favicon.ico" />
 
 
 	<!-- Meta -->
 	<title>{{ Meta.Title }}</title>
-  <meta name="description" content="{{ Meta.Description }}" />
-  <meta name="keywords" content="{{ Meta.Keywords }}" />
-	
+    <meta name="description" content="{{ Meta.Description }}" />
+    <meta name="keywords" content="{{ Meta.Keywords }}" />
 
 	<link rel="stylesheet" type="text/css" href="project-files/css/preloader.css">
 
-
+	{% include "partials/matomo.html" with siteId=89 %}
 </head>
 
 <body>
@@ -33,13 +32,11 @@
 				<span class="text">Menu</span>	
 			</a>
 		</div>
-		
 	</header>
 
 	<!-- ========== Slider ========== -->
 	<section class="slider white_arrows" data-dots="true" data-arrows="true">
 	</section>
-	
 
 	<!-- ========== Navigation ========== -->
 	<div class="navholder" id="nav">
@@ -60,7 +57,6 @@
 					</li>
 					{% endfor %}
 				</ul>
-				
 			</nav>
 		</div>
 	</div>
@@ -78,9 +74,9 @@
 		<div class="white_section section_padding">
 			<div class="container">
 				{{ BodyParts.1 }}
-			</div>	
+			</div>
 		</div>
-		
+
 		{% if NavActive.2.SubSlice %}
 		<div class="section_padding" style="border-top: 1px solid #888;">
 			<div class="container">
@@ -96,18 +92,16 @@
 								</p>
 								<a href="{{ nav.GoTo }}" class="btn">mehr lesen ยป</a>
 							</div>
-							
 						</div>
 					</div>
 				{% endfor %}
 				</div>
-				
 			</div>
-		</div>	
+		</div>
 		{% endif %}
 
 	</div>
-	
+
 	<!-- ========== Footer ========== -->
 	<footer id="footer">
 		<div class="container">
@@ -141,7 +135,6 @@
 		</div>
 	</section>
 
-	
 
 	<!-- ========== SCROLL TOP ========== -->
 	<div class="scrolltop">
@@ -168,6 +161,6 @@
 
 
 	<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.0.0/mermaid.min.js"></script>
-	
+
 </body>
 </html>
diff --git a/website/templates/partials/matomo.html b/website/templates/partials/matomo.html
new file mode 100644
index 0000000..ef68587
--- /dev/null
+++ b/website/templates/partials/matomo.html
@@ -0,0 +1,17 @@
+<!-- Matomo -->
+<script type="text/javascript">
+  var _paq = window._paq || [];
+  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
+  _paq.push(["setCookieDomain", "*.mark2web.de"]);
+  _paq.push(['trackPageView']);
+  _paq.push(['enableLinkTracking']);
+  (function() {
+    var u="https://www.basisstats.de/";
+    _paq.push(['setTrackerUrl', u+'matomo.php']);
+    _paq.push(['setSiteId', '{{ siteId|default:0 }}']);
+    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+'matomo.js'; s.parentNode.insertBefore(g,s);
+  })();
+</script>
+<noscript><p><img src="https://www.basisstats.de/matomo.php?idsite=89&amp;rec=1" style="border:0;" alt="" /></p></noscript>
+<!-- End Matomo Code -->