Skip to content

ReactでGoogleAnalyticsの設定をする【UA, GA4対応版】のサンプルコード

Notifications You must be signed in to change notification settings

mamezou/send-ga-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReactでGoogleAnalyticsの設定【UA, GA4対応版|プラグインなし】

Zenn記事のサンプルコード

状態

CRA を TypeScript で行い、react-router-dom をインストール。 その後、トラッキングの設定を行っている。 最低限トップページとアバウトページを用意した。

インストール

git clone git@github.com:mamezou/send-ga-react.git
cd send-ga-react
yarn
yarn start

設定方法

最低限以下ファイルの UA と G から始まる箇所を変更すれば使える。 なお、env ファイルで管理する方法もあるが省略。 public/index.html src/router/router.tsx

About

ReactでGoogleAnalyticsの設定をする【UA, GA4対応版】のサンプルコード

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published