FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

integrate gtag · javascriptit/sync2@67341ef · GitHub

Repository navigation

Commit 67341ef

Browse files
committed
integrate gtag
1 parent 530efbe commit 67341ef

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎package-lock.json‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"vue-async-computed": "^3.8.2",
5858
"vue-class-component": "^7.2.2",
5959
"vue-fragment": "^1.5.1",
60+
"vue-gtag": "^1.10.0",
6061
"vue-i18n": "^8.0.0",
6162
"vue-property-decorator": "^8.3.0",
6263
"vue-router-stack": "^1.3.3",

‎src/boot/misc/plugins.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ import Vue from 'vue'
22
import AsyncComputed from 'vue-async-computed'
33
// eslint-disable-next-line @typescript-eslint/no-var-requires
44
const Fragment = require('vue-fragment')
5+
import VueGtag from 'vue-gtag'
56

67
export function boot() {
78
Vue.use(AsyncComputed, { errorHandler: false } as never)
89
Vue.use(Fragment.Plugin)
10+
Vue.use(VueGtag, {
11+
config: { id: '259251618' },
12+
enabled: process.env.NODE_ENV === 'production',
13+
disableScriptLoad: process.env.NODE_ENV !== 'production'
14+
})
915
}

‎src/pages/Sign/Controller.vue‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ export default Vue.extend({
138138
}
139139
const request = RelayedRequest.validate(JSON.parse(resp.data))
140140
request.origin = resp.headers['x-data-origin']
141+
// eslint-disable-next-line @typescript-eslint/camelcase
142+
this.$gtag.event('connex-sign', { event_label: request.origin })
141143
this.postStatus(ACCEPTED_SUFFIX, {})
142144
// TODO validate body
143145
return request

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL