From 86cc8bbf9dd105c5eefbd8a6797f75ecd9942d99 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Tue, 20 Feb 2024 11:07:35 +0800 Subject: [PATCH] test ga4 --- resources/assets/vue/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/assets/vue/app.js b/resources/assets/vue/app.js index abb7a17e..2fedd45b 100644 --- a/resources/assets/vue/app.js +++ b/resources/assets/vue/app.js @@ -99,6 +99,13 @@ const app = new Vue({ } else { this.render(); } + + // GA4 - push user_id + if (this.$store.getters.getUserId) { + dataLayer.push({ + 'user_id': this.$store.getters.getUserId, + }); + } }, render() { this.captchaId = window.grecaptcha.render('grecaptcha_container', {