Skip to content

Commit 94e1575

Browse files
committed
Add tracking
1 parent c5e1e2f commit 94e1575

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

components/Map/index.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default {
1515
},
1616
methods: {
1717
createMap(token) {
18+
const self = this
1819
const mapboxgl = require('mapbox-gl/dist/mapbox-gl')
1920
mapboxgl.accessToken = token
2021
@@ -118,6 +119,12 @@ export default {
118119
zoom: zoom
119120
})
120121
})
122+
123+
self.$gtag('event', 'clustered', {
124+
eventAction: 'click',
125+
eventLabel: 'cluster click',
126+
eventValue: clusterId
127+
})
121128
})
122129
123130
map.on('click', 'unclustered-point', function(e) {
@@ -153,6 +160,12 @@ export default {
153160
</div>
154161
`)
155162
.addTo(map)
163+
164+
self.$gtag('event', 'unclustered', {
165+
eventAction: 'click',
166+
eventLabel: 'unclustered click',
167+
eventValue: title
168+
})
156169
})
157170
158171
map.on('mouseenter', 'clusters', _ => map.getCanvas().style.cursor = 'pointer')

nuxt.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ module.exports = {
7575
** GTAG configuration
7676
*/
7777
'google-gtag': {
78-
debug: true,
7978
id: process.env.GA,
8079
config: {
8180
send_page_view: true

0 commit comments

Comments
 (0)