Skip to content

Commit

Permalink
Merge pull request #420 from alercebroker/feat/revive-analytics
Browse files Browse the repository at this point in the history
Feat: Revive analytics
  • Loading branch information
HectorxH authored May 14, 2024
2 parents 6b81482 + 54e1e8b commit ebd549a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
AVRO_API_BASE_URL: ${{ secrets.AVRO_API_BASE_URL }}
CATSHTM_API_BASE_URL: ${{ secrets.CATSHTM_API_BASE_URL }}
GOOGLE_REDIRECT_URI: ${{ secrets.GOOGLE_REDIRECT_URI }}
GOOGLE_TAG_ID: ${{ secrets.GOOGLE_TAG_ID }}
TNS_API_BASE_URL: ${{ secrets.TNS_API_BASE_URL }}
USERS_API_BASE_URL: ${{ secrets.USERS_API_BASE_URL }}
ZTF_API_BASE_URL: ${{ secrets.ZTF_API_BASE_URL }}
Expand Down
24 changes: 5 additions & 19 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default {
'@/plugins/validation.js',
'@/plugins/dataReleaseApi.js',
'@/plugins/users.js',
'@/plugins/gtag.js',
],
router: {
middleware: 'auth',
Expand All @@ -76,11 +77,7 @@ export default {
buildModules:
process.env.NODE_ENV !== 'production'
? ['@nuxtjs/vuetify', '@alerce/components/nuxt', '@nuxtjs/eslint-module']
: [
'@nuxtjs/vuetify',
'@alerce/components/nuxt',
'@nuxtjs/google-analytics',
],
: ['@nuxtjs/vuetify', '@alerce/components/nuxt'],
/*
** Nuxt.js modules
*/
Expand All @@ -90,12 +87,7 @@ export default {
'@nuxtjs/toast',
'@nuxtjs/pwa',
],
googleAnalytics: {
id:
process.env.NODE_ENV === 'production'
? process.env.GOOGLE_ANALYTICS_ID
: '',
},

/*
** Process runtime config
*/
Expand All @@ -110,18 +102,12 @@ export default {
ztfApiBaseUrl:
process.env.ZTF_API_BASE_URL ||
'https://dev-api.alerce.online/alerts/v1/',
ztfApiv2Url:
process.env.ZTF_V2_API_URL || 'https://api.alerce.online/v2',
ztfApiv2Url: process.env.ZTF_V2_API_URL || 'https://api.alerce.online/v2',
usersApiBaseUrl:
process.env.USERS_API_BASE_URL || 'https://dev.users.alerce.online/users',
googleRedirectUri:
process.env.GOOGLE_REDIRECT_URI || 'http://localhost:3000/oauth/',
googleAnalytics: {
id:
process.env.NODE_ENV === 'production'
? process.env.GOOGLE_ANALYTICS_ID
: '',
},
googleTagId: process.env.GOOGLE_TAG_ID,
},
privateRuntimeConfig: {},
/*
Expand Down
17 changes: 16 additions & 1 deletion package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"nuxt-property-decorator": "^2.7.2",
"qs": "^6.9.4",
"vee-validate": "^3.4.5",
"vue-echarts": "^5.0.0-beta.0"
"vue-echarts": "^5.0.0-beta.0",
"vue-gtag": "^1.16.1"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^3.0.0",
Expand Down
14 changes: 14 additions & 0 deletions plugins/gtag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Vue } from 'nuxt-property-decorator'
import VueGtag from 'vue-gtag'

export default function ({ $config, app }) {
Vue.use(
VueGtag,
{
config: { id: $config.googleTagId },
pageTrackerEnabled: true,
deferScriptload: true,
},
app.router
)
}

0 comments on commit ebd549a

Please sign in to comment.