Skip to content

Commit

Permalink
Merge pull request #30 from spothound/googleAnalytics
Browse files Browse the repository at this point in the history
Add google analytics
  • Loading branch information
spothound authored Jul 7, 2024
2 parents 1cb6d3b + ccccb9d commit 99cbfab
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 13 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"uuid": "^9.0.1",
"vue": "^3.4.3",
"vue-echarts": "^6.6.8",
"vue-gtag-next": "^1.14.0",
"vue-router": "^4.2.5",
"vue3-chessboard": "^1.3.2",
"vue3-google-login": "^2.0.26",
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 20 additions & 12 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
import { createApp, type Plugin } from 'vue'
import App from './App.vue'
import '@/assets/styles/index.css'
import vue3GoogleLogin from 'vue3-google-login'
const apiUrl = import.meta.env.VUE_APP_API_URL || 'https://api.thepawnsjourney.live';
import { createApp, type Plugin } from 'vue';
import App from './App.vue';
import '@/assets/styles/index.css';
import vue3GoogleLogin from 'vue3-google-login';
import { createGtm } from '@gtm-support/vue-gtm';

Check failure on line 5 in src/main.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find module '@gtm-support/vue-gtm' or its corresponding type declarations.
import router from './router'; // Import your router here

Check failure on line 6 in src/main.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find module './router' or its corresponding type declarations.

const apiUrl = import.meta.env.VUE_APP_API_URL || 'https://api.thepawnsjourney.live';

const app = createApp(App)
const app = createApp(App);

Object.values(
import.meta.glob<Plugin>('./plugins/*.ts', {
eager: true,
import: 'default',
}),
).forEach((v) => app.use(v))
).forEach((v) => app.use(v));

app.use(vue3GoogleLogin, {
clientId: '368514305696-6nuvllac0utemf8ad4ch38j6h002ih3g.apps.googleusercontent.com'
})
clientId: '368514305696-6nuvllac0utemf8ad4ch38j6h002ih3g.apps.googleusercontent.com',
});

app.use(createGtm({
id: 'G-G-SE7XN0JDRV',
vueRouter: router
}));

app.use(router);

// make a dummy request to the API to bring it up if needed
fetch(`${apiUrl}/`)
fetch(`${apiUrl}/`);

app.mount('#app')
app.mount('#app');
8 changes: 7 additions & 1 deletion src/pages/changelog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ const changelog = [
icon: 'mdi-home-floor-1',
size: 'large'
},
// Add more entries here...
{
title: 'v1.0.1',
text: 'Google Analytics added to track user interactions and improve the website.',
color: 'bg-purple-lighten-2',
icon: 'mdi-home-floor-1',
size: 'medium'
},
];
</script>
Expand Down

0 comments on commit 99cbfab

Please sign in to comment.