gtag push user id

This commit is contained in:
edmondlang
2024-06-09 22:13:56 +08:00
parent c4bbc1a967
commit b7b2ab602a
4 changed files with 14 additions and 12 deletions
+1
View File
@@ -31,6 +31,7 @@
"vue": "^2.6.10",
"vue-avatar": "^2.1.8",
"vue-debounce": "^2.6.0",
"vue-gtag": "^1.16.1",
"vue-template-compiler": "^2.6.10",
"vue-the-mask": "^0.11.1",
"vuelidate": "^0.7.4",
+13
View File
@@ -2,6 +2,7 @@
/** Dependencies */
import Vue from 'vue'
import store from './vuex/store';
import VueGtag from 'vue-gtag'
window.route = require('./general/functions/router');
@@ -54,6 +55,18 @@ Vue.component(Avatar);
const files = require.context('./', true, /\.vue$/i);
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
// Google Analytics 4 (GA4) Integration
Vue.use(VueGtag, {
property: {
id: 'G-FEJNZTR0WP',
params: {
user_id: store.getters.getUserId
}
}
});
console.log('Google Tag pushed');
const app = new Vue({
el: '#app',
store,
-4
View File
@@ -9,10 +9,6 @@
}
</style>
<body class="horizontal-menu horizontal-app-menu bg-master-lightest overflow-hidden">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TQKCPCD"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div id="app" style="min-height: 100%;">
<div id="grecaptcha_container"></div>
@yield('content')
-8
View File
@@ -1,11 +1,3 @@
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-TQKCPCD');</script>
<!-- End Google Tag Manager -->
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<meta charset="utf-8"/>
<title>Exchange - Overseas Money Transfers</title>