From 129e3c9928f133099480515e30b70cd9b3213a8d Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Tue, 29 Jul 2025 23:01:47 +0200 Subject: [PATCH] Removed cookies page and changed the way google analytics script is initialized --- .../controllers/cookie_consent_controller.js | 15 +++- .../Website/Controller/HomeController.php | 7 -- web/landing/templates/base.html.twig | 2 - web/landing/templates/main/cookies.html.twig | 77 ------------------- 4 files changed, 11 insertions(+), 90 deletions(-) delete mode 100644 web/landing/templates/main/cookies.html.twig diff --git a/web/landing/assets/controllers/cookie_consent_controller.js b/web/landing/assets/controllers/cookie_consent_controller.js index 3c2f2ca32c..caf6c2d2cb 100644 --- a/web/landing/assets/controllers/cookie_consent_controller.js +++ b/web/landing/assets/controllers/cookie_consent_controller.js @@ -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() { diff --git a/web/landing/src/Flow/Website/Controller/HomeController.php b/web/landing/src/Flow/Website/Controller/HomeController.php index 1ec0b19d42..60cac49812 100644 --- a/web/landing/src/Flow/Website/Controller/HomeController.php +++ b/web/landing/src/Flow/Website/Controller/HomeController.php @@ -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 { diff --git a/web/landing/templates/base.html.twig b/web/landing/templates/base.html.twig index 16793a60c2..e1efe941e1 100644 --- a/web/landing/templates/base.html.twig +++ b/web/landing/templates/base.html.twig @@ -37,7 +37,6 @@ {% endblock %} {% block tracking %} - {% endblock %} diff --git a/web/landing/templates/main/cookies.html.twig b/web/landing/templates/main/cookies.html.twig deleted file mode 100644 index c656ff2428..0000000000 --- a/web/landing/templates/main/cookies.html.twig +++ /dev/null @@ -1,77 +0,0 @@ -{% extends 'base.html.twig' %} - -{%- block title -%} - Flow PHP - Data Processing Framework -{%- endblock -%} - -{%- block description -%} - Flow is a PHP-based, strongly typed data processing framework with low memory footprint that can process various data sources consistently. - It offers a unified API for all data sources, including CSV, JSON, XML, Text, Parquet, Avro, Rest API, RDBMS, Elasticsearch / Meilisearch. - Flow not only enables you to process various data sources consistently, but also strives to accurately detect data types and cast them to the appropriate PHP types. -{%- endblock -%} - -{#{% block tracking %}#} -{#{% endblock %}#} - -{% block hero %} -{% endblock %} - -{% block main %} -
-
-

Too bad... But your Privacy is our Motivation

-

- We completely respect your decision to reject cookies. However, before you go, - we’d like to share why these cookies are so vital for our open-source project’s - progress. -

- -

1. Showing Us What Matters

-

- Cookies let us see which features people use the most and where improvements - are truly needed. We don’t track personal information—only anonymized statistics - that reveal which parts of our project spark the most interest. -

- -

2. Fueling Our Motivation

-

- We’re a team of open-source enthusiasts, and seeing active engagement gives us - a real morale boost. When we notice spikes in traffic or a rise in feature usage, - it affirms that the community finds our work valuable, and it inspires us to - keep innovating. -

- -

3. Free & Always Improving

-

- By understanding usage trends, we can direct our time and limited resources - toward the features that matter most. This ensures our project remains free, - relevant, and beneficial for everyone who relies on it. -

- -

4. Respecting Your Data

-

- We take privacy seriously. Any information gathered remains anonymous and - helps us enhance functionality based on collective interests rather than - individual profiles. -

- -

- Thank you for considering how essential cookies are to our open-source efforts! -

- - -
- - - - Back to Homepage - -
-
-
-{% endblock %}