- devbookclub
- github clone
- 노마드코더
- 포그리트
- law of ux
- 존 야블론스키
- Day.js
- data management
- Google Analytics
- Clean Code
- 개발자북클럽
- 구글 애널리틱스
- 클린코드
- 구글애널리틱스
- Jon Yablonski
- cleancode
- nomad coders
- Day js
- react ga4
- uxui
- React
- FOUR GRIT
- react ga
- github
- 깃헙 클론 에러
- NomadCoders
- UX
- 노개북
- react scripts
- Data Driven UX
TURI BLOG
[GA4] Initial Code Snippets to Apply to Google Analytics 본문
[GA4] Initial Code Snippets to Apply to Google Analytics
TURI BLOG 2024. 1. 2. 16:15
Initial Code Snippets to Apply to Google Analytics
My task was to set up the initial stage of Google Analytics for the website to analyze user behavior and needs in the future.
The challenges encountered:
- Uncertainty about the difference between react-ga and react-ga4
- Uncertainty about how to apply react-ga4 to the code with the existing initial GA measurement ID, including the initial setting on the code
- What and where to apply for Google Analytics tracking
My approach to tackling these challenges:
- Installed react-ga4 instead of react-ga
- Created an account on Google Analytics and linked the existing measurement ID to the new accounts' tag
- Tested on local with Google Analytics's Preview environment
- Applied and tested the code on button events that don't change the URLs
Here's my approach:
1. Installed react-ga4 instead of react-ga
I believed it was necessary to use react-ga4 for the website, especially if we aim to collect and analyze specific events, not only universal data.

2. Created a new account in Google Analytics and linked the existing measurement ID to the new accounts' tag
I encountered difficulties accessing tag managers and testing preview environments, as shown in the official YouTube video.

As a workaround, I created a new account and linked its tag to the existing measurement ID
3. Tested on local with Google Analytics's Preview environment

4. Applied and tested the code on button events that don't change the URLs
Code snippets & questions :
However, I was uncertain about creating customized events on Google Analytics 4 using tag managers.
The final code for the initial setup involved adding event parameters instead of utilizing customized events.

https://support.google.com/analytics/answer/13675006?hl=en
[GA4] Event parameters - Analytics Help
An event parameter is an additional piece of data about a user interaction on a website and/or app, offering valuable context and details about the interaction. By using the data from an event parameter, you can dissect user behavior with a high level of g
support.google.com
Therefore, the process of creating a new account and linking the existing measurement ID to its new tag was not applied to the current analysis code state.
And I am wondering
what the specific cases are that require customized event tags.
'[TIL]Today I Learned' 카테고리의 다른 글
Laws of UX: Using Psychology to Design Better Products & Services, Jon Yablonski (3) | 2024.01.04 |
---|---|
[GA4] How to approach website analysis referring to the book, Data-Driven UX? (0) | 2023.12.09 |
[GA4] What to Know Before Applying to GA4 (0) | 2023.11.06 |
[Day.js] Format, Relative Time, and more about Day js (0) | 2023.10.10 |