From 7d73a48367ac356a3f0da5fd3ed39c20828c761d Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 25 May 2022 09:23:55 +0000 Subject: [PATCH] [IMP] website: push 404 event to plausible This Goal will help end user to find most 404 hits and fix the legits one... Fixing typo, creating missing redirect, or fixing code. We need to cast the event-name since plausible only accept 'string' as custom event name, so if we push 404 instead of '404' the event crash. closes odoo/odoo#92243 Signed-off-by: Romain Derie (rde) --- addons/website/static/src/js/plausible.js | 2 +- addons/website/views/website_templates.xml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/website/static/src/js/plausible.js b/addons/website/static/src/js/plausible.js index fa8e3027faf..72ddb281f52 100644 --- a/addons/website/static/src/js/plausible.js +++ b/addons/website/static/src/js/plausible.js @@ -25,7 +25,7 @@ publicWidget.registry.o_plausible_push = publicWidget.Widget.extend({ * `data-event-params` */ _push() { - const evName = this.$el.data('event-name'); + const evName = this.$el.data('event-name').toString(); const evParams = this.$el.data('event-params') || {}; window.plausible(evName, {props: evParams}); }, diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 1e2928fd3fa..449a914df51 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -2174,6 +2174,12 @@ + +