Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions web/landing/assets/controllers/cookie_consent_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@ export default class extends Controller {
});
this.hideBanner();
this.showButton();
window.location.href = '/cookies';
}

consentGranted() {
gtag("consent", "update", {
analytics_storage: 'granted'
});
if (document.querySelector('script[src="https://www.googletagmanager.com/gtag/js?id=' + this.gaIdValue + '"]')) {
return;
}

const script = document.createElement('script');
script.async = true;
script.src = 'https://www.googletagmanager.com/gtag/js?id=' + this.gaIdValue;
document.head.appendChild(script);

gtag("consent", "update", {analytics_storage: 'granted'});
gtag('js', new Date());
}

showBanner() {
Expand Down
7 changes: 0 additions & 7 deletions web/landing/src/Flow/Website/Controller/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ public function __construct(
) {
}

#[Route('/cookies', name: 'cookies', options: ['sitemap' => false])]
public function cookies() : Response
{
return $this->render('main/cookies.html.twig', [
]);
}

#[Route('/', name: 'home', options: ['sitemap' => true])]
public function home() : Response
{
Expand Down
2 changes: 0 additions & 2 deletions web/landing/templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
{% endblock %}

{% block tracking %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
Expand All @@ -49,7 +48,6 @@
ad_storage: 'denied',
analytics_storage: 'denied'
});
gtag('js', new Date());
gtag('config', '{{ google_analytics_id }}');
</script>
{% endblock %}
Expand Down
77 changes: 0 additions & 77 deletions web/landing/templates/main/cookies.html.twig

This file was deleted.