Skip to content

Commit

Permalink
feat: analytics (#116)
Browse files Browse the repository at this point in the history
* feat(analytics): add hubspot

* pref(hubspot): add analytics script to end of body

* feat(analytics): google and hubspot

* fix(analytics): add plugin

* fix(analytics): guard injection

* feat(analytics): add segment

* feat(analytics): add firebase

* perf(analytics): preconnect for google analytics

* Revert "feat(analytics): add firebase"

This reverts commit ce4f8db.

* chore: remove dotenv

* perf: remove unused preconnects

* feat(analytics): google

* chore(analytics): default id

Co-authored-by: Damien Robinson <damien.robinson@xcommedia.com.au>
  • Loading branch information
shadow81627 and damienrobinson committed Sep 21, 2020
1 parent 08a42b7 commit e8c52a0
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 254 deletions.
24 changes: 17 additions & 7 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ const env = {
process.env.TRAVIS_COMMIT ||
process.env.VERCEL_GITHUB_COMMIT_SHA,
DATE_GENERATED: new Date().toISOString(),
APP_NAME: process.env.APP_NAME || pkg.name,
};

const preconnectLinks = [];

export default {
mode: 'universal',
target: 'static',

publicRuntimeConfig: {
...env,
googleAnalytics: {
id: process.env.GOOGLE_ANALYTICS_ID || 'UA-176793964-1',
},
},

generate: {
Expand Down Expand Up @@ -86,7 +92,16 @@ export default {
content: pkg.version,
},
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
...preconnectLinks.map((href) => ({
rel: 'preconnect',
href,
hid: `preconnect-${href}`,
crossorigin: 'anonymous',
once: true,
})),
],
noscript: [{ innerHTML: 'This website requires JavaScript.' }],
},

Expand Down Expand Up @@ -125,6 +140,7 @@ export default {
// '@nuxtjs/stylelint-module',
'@nuxtjs/vuetify',
'@aceforth/nuxt-optimized-images',
'@nuxtjs/google-analytics',
],

/*
Expand All @@ -138,7 +154,6 @@ export default {
'nuxt-fontawesome',
'nuxt-i18n',
// 'nuxt-webfontloader',
// 'nuxt-purgecss',

// always declare the sitemap module at end of array
'@nuxtjs/sitemap',
Expand Down Expand Up @@ -190,11 +205,6 @@ export default {
},
},

purgeCSS: {
// your settings here
mode: 'postcss',
},

sitemap: {
hostname: 'https://daim.dev',
},
Expand Down

1 comment on commit e8c52a0

@vercel
Copy link

@vercel vercel bot commented on e8c52a0 Sep 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.