Implement Google Tag Manager integration based on cookie consent; remove bank account info from contact page
This commit is contained in:
@@ -39,10 +39,27 @@ function template_header($title,$head) {
|
||||
if (maintenanceMode){$maintenanceMode = maintenanceMode();} else {$maintenanceMode = '';}
|
||||
|
||||
$veliti_analytics = '';
|
||||
if (veliti_analytics){
|
||||
if (veliti_analytics && $_COOKIE['cookie_consent'] == 'accepted'){
|
||||
$veliti_analytics = '<script src="'.$base_url.'/lib/analytics/analytics.js"></script>';
|
||||
}
|
||||
|
||||
$tag_manager_header = '';
|
||||
$tag_manager_body = '';
|
||||
|
||||
if (isset($_COOKIE['cookie_consent']) && $_COOKIE['cookie_consent'] == 'accepted') {
|
||||
|
||||
$tag_manager_header = "
|
||||
<script>
|
||||
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','GTM-WZTRW84Q');
|
||||
</script>";
|
||||
|
||||
$tag_manager_body = '<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WZTRW84Q" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>';
|
||||
}
|
||||
|
||||
$view = '
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -54,6 +71,7 @@ $view = '
|
||||
<link href="'.base_url.'custom/css/main.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
|
||||
'.$head.'
|
||||
'.$tag_manager_header.'
|
||||
<script>
|
||||
// Wait for DOM to be ready before accessing elements
|
||||
document.addEventListener(\'DOMContentLoaded\', function() {
|
||||
@@ -153,6 +171,7 @@ $view = '
|
||||
'.$veliti_analytics.'
|
||||
</head>
|
||||
<body>
|
||||
'.$tag_manager_body.'
|
||||
<!-- Loading Bar -->
|
||||
<div class="loading-container" id="loadingScreen">
|
||||
<div class="loading-bar">
|
||||
@@ -875,7 +894,7 @@ function cookie_consent() {
|
||||
<script>
|
||||
document.getElementById("accept-cookies").onclick = function() {
|
||||
document.cookie = "cookie_consent=accepted; path=/; max-age=15768000";
|
||||
document.getElementById("cookie-consent-banner").style.display = "none";
|
||||
location.reload();
|
||||
};
|
||||
document.getElementById("decline-cookies").onclick = function() {
|
||||
document.cookie = "cookie_consent=declined; path=/; max-age=15768000";
|
||||
|
||||
@@ -161,7 +161,6 @@ defined(security_key) or exit;
|
||||
<p><strong>Email:</strong> <a href="mailto:<?php echo footer_email; ?>"><?php echo footer_email; ?></a></p>
|
||||
<p><strong>Chamber of Commerce:</strong> <?php echo company_kvk; ?></p>
|
||||
<p><strong>VAT Number:</strong> NL004729776B54</p>
|
||||
<p><strong>Bank Account:</strong> <?php echo company_bank; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user