Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #250 from y-chan/development
Browse files Browse the repository at this point in the history
google analyticsが正しく設定できていない問題の修正
  • Loading branch information
y-chan authored Apr 17, 2020
2 parents 45e0479 + 58cefd8 commit ca37f04
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ jobs:
- run: yarn install --frozen-lockfile
- run: yarn run test
- run: yarn run generate:dev --fail-on-page-error
- name: generate
run: |
echo "GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID}" >> .env.development
cat .env.development
yarn run generate:dev --fail-on-page-error
env:
GOOGLE_ANALYTICS_TRACKING_ID: UA-160592267-3
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID_DEVELOP }}

- run: "echo \"User-agent: *\nDisallow: /\" > ./dist/robots.txt"

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ jobs:
- run: yarn install --frozen-lockfile
- run: yarn run test
- run: yarn run generate:dev --fail-on-page-error
- name: generate
run: |
echo "GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID}" >> .env.development
cat .env.development
yarn run generate:dev --fail-on-page-error
env:
GOOGLE_ANALYTICS_TRACKING_ID: UA-160592267-2
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID_STAGING }}

- run: "echo \"User-agent: *\nDisallow: /\" > ./dist/robots.txt"

Expand Down
8 changes: 4 additions & 4 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ const config: Configuration = {
'@nuxtjs/stylelint-module',
'@nuxtjs/vuetify',
'@nuxt/typescript-build',
[
'@nuxtjs/google-analytics',
{ id: process.env.GOOGLE_ANALYTICS_TRACKING_ID || 'dummy' }
]
'@nuxtjs/google-analytics'
],
/*
** Nuxt.js modules
Expand Down Expand Up @@ -125,6 +122,9 @@ const config: Configuration = {
exclude: [''], // Sitemapから除外する項目
routes: ['/about'] // Sitemapに追加する項目
},
googleAnalytics: {
id: process.env.GOOGLE_ANALYTICS_ID // .env.production などに設定してください。
},
optionalCookies: [
{
name: 'i18n_redirected',
Expand Down

0 comments on commit ca37f04

Please sign in to comment.