Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REP-240 Switch from GA to Cabin #39

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/BusinessPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ export default {
this.busy = false

// Track the search.
this.$ga.event(
this.cabin(
'search',
'submit_' + this.region,
this.category || 'All Categories'
)

this.$ga.event(
this.cabin(
'search',
'location_' + this.region,
this.location || 'No location'
Expand All @@ -421,7 +421,7 @@ export default {
const value = [business.name, business.address, business.postcode].join(
', '
)
this.$ga.event('map', 'select_' + this.region, value)
this.cabin('map', 'select_' + this.region, value)
},
showMoreInfo() {
this.waitForRef('moreinfomodal', () => {
Expand Down
16 changes: 16 additions & 0 deletions mixins/cabin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Vue from 'vue'

Vue.mixin({
methods: {
cabin(event, p1, p2) {
console.log('Event', event, p1, p2)
window.cabin.event(
JSON.stringify({
event,
p1,
p2,
})
)
},
},
})
2 changes: 1 addition & 1 deletion mixins/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Vue.mixin({
}
},
trackOutboundLink(url) {
this.$ga.event('outbound', 'click_' + this.region, url)
this.cabin('outbound', 'click_' + this.region, url)
},
buildHead(title, description, image) {
const meta = [
Expand Down
15 changes: 4 additions & 11 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ export default {
href: 'https://fonts.googleapis.com/css?family=Poppins',
},
],
script: [
{ src: 'https://scripts.withcabin.com/hello.js', ssr: false, defer: true },
]
},

css: ['@/assets/css/global.scss'],

plugins: [
{ src: '~/mixins/global.js' },
{ src: '~/mixins/cabin.js' },
{ src: '~/plugins/axios-baseurl' },
{ src: '@/plugins/vue-google-maps', ssr: false },
{ src: '@/plugins/vue2-leaflet', ssr: false },
Expand All @@ -47,7 +51,6 @@ export default {

buildModules: [
'@nuxtjs/eslint-module',
'@nuxtjs/google-analytics',
'@nuxtjs/google-fonts',
],

Expand Down Expand Up @@ -148,16 +151,6 @@ export default {
},
},

googleAnalytics: {
id: 'UA-46050944-3',

// Enable debug in development mode so that we can see what events are tracked.
debug: {
enabled: process.env.NODE_ENV !== 'production',
sendHitTask: true,
},
},

googleFonts: {
families: {
'Patua One': [300, 400, 600],
Expand Down
13 changes: 0 additions & 13 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"dependencies": {
"@nuxtjs/axios": "^5.12.2",
"@nuxtjs/google-analytics": "^2.4.0",
"@nuxtjs/google-fonts": "^1.2.0",
"@nuxtjs/pwa": "^3.0.2",
"axios": "^0.21.1",
Expand Down