29
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Nuxt.jsで超絶簡単にGoogle Analyticsを導入する

Posted at

Nuxt.jsで静的ページを作って、GoogleAnalytics(GA)を導入したい!!!ってなったときのメモです。

手順1: パッケージをインストールする

$ npm install --save @nuxtjs/google-analytics

または

$ yarn add @nuxtjs/google-analytics

手順2: nuxt.config.jsに下記を追記する

{
  modules: [
    ['@nuxtjs/google-analytics', {
      id: 'paste your id here'
    }]
 ]
}

あとは、netlifyなりGithub pagesなりにデプロイすれば、GAで値が取得できているはずです。
簡単ですね!

参考資料

Google アナリティクスを使うには?
https://ja.nuxtjs.org/faq/google-analytics#google-%E3%82%A2%E3%83%8A%E3%83%AA%E3%83%86%E3%82%A3%E3%82%AF%E3%82%B9%E3%82%92%E4%BD%BF%E3%81%86%E3%81%AB%E3%81%AF-

29
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?