From 3f96225924479d1dfeab37183faee5f704e484ea Mon Sep 17 00:00:00 2001 From: Albin Date: Mon, 9 Oct 2023 22:00:17 +0200 Subject: [PATCH] #1274 Upgrade to Google Analytics 4 --- app/Resources/views/base.html.twig | 16 ++-- .../views/event/ticket/payment.html.twig | 83 +++++++++---------- .../views/google_analytics.html.twig | 9 ++ app/config/parameters.yml.dist | 2 +- app/config/parameters.yml.dist-docker | 2 +- .../AppBundle/Controller/Admin/HomeAction.php | 2 +- 6 files changed, 56 insertions(+), 58 deletions(-) create mode 100644 app/Resources/views/google_analytics.html.twig diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index 79f0eecc9..524f1aa1d 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -15,16 +15,12 @@ - {% if google_analytics_enabled %} - - {% endif %} + + {% block google_analytics %} + {% if google_analytics_enabled %} + {% include 'google_analytics.html.twig' %} + {% endif %} + {% endblock %} Aller au contenu diff --git a/app/Resources/views/event/ticket/payment.html.twig b/app/Resources/views/event/ticket/payment.html.twig index ff05e9869..ef0e55cf5 100644 --- a/app/Resources/views/event/ticket/payment.html.twig +++ b/app/Resources/views/event/ticket/payment.html.twig @@ -8,6 +8,10 @@ {% endblock %} +{% block google_analytics %} + {% include 'google_analytics.html.twig' %} +{% endblock %} + {% block content %}
{% if not invoice.isFree %} @@ -45,70 +49,59 @@

Nous avons bien reçu votre inscription et nous vous en remercions !

- Si vous avez la moindre question, n'hésitez pas à contacter bonjour@afup.org. +

+ Si vous avez la moindre question, n'hésitez pas à contacter bonjour@afup.org.

Vous allez recevoir dans quelques instants la facture à l'adresse email de facturation.

{% endif %} + {% autoescape 'js' %} - {% endautoescape %} {% endblock %} diff --git a/app/Resources/views/google_analytics.html.twig b/app/Resources/views/google_analytics.html.twig new file mode 100644 index 000000000..8da548418 --- /dev/null +++ b/app/Resources/views/google_analytics.html.twig @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index e398e1bc9..1b73ab6b0 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -51,7 +51,7 @@ parameters: super_apero_csv_url: "" google_analytics_enabled: false - google_analytics_id: "UA-192127-3" + google_analytics_id: "G-CHPWDR3C1M" techletter_test_email_address: "pole-veille@afup.org" diff --git a/app/config/parameters.yml.dist-docker b/app/config/parameters.yml.dist-docker index ec91ec0ca..559f9952f 100644 --- a/app/config/parameters.yml.dist-docker +++ b/app/config/parameters.yml.dist-docker @@ -54,7 +54,7 @@ parameters: super_apero_csv_url: "" google_analytics_enabled: false - google_analytics_id: "UA-192127-3" + google_analytics_id: "G-CHPWDR3C1M" techletter_test_email_address: "pole-veille@afup.org" diff --git a/sources/AppBundle/Controller/Admin/HomeAction.php b/sources/AppBundle/Controller/Admin/HomeAction.php index 186cb3802..80d53d921 100644 --- a/sources/AppBundle/Controller/Admin/HomeAction.php +++ b/sources/AppBundle/Controller/Admin/HomeAction.php @@ -62,7 +62,7 @@ public function __invoke() { $nextevents = $this->eventRepository->getNextEvents(); $cards = []; - if ($this->security->isGranted('ROLE_FORUM')) { + if ($this->security->isGranted('ROLE_FORUM') && $nextevents) { foreach ($nextevents as $event) { $stats = $this->eventStatsRepository->getStats($event->getId()); $info = [];