GA4 준비시 주의사항 (UA에서 GA4 데이터 연동할 때)

현재 UA를 사용중이고
GA 태그가
-------------------
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-1234????-1', 'auto');
ga('send', 'pageview');
-------------------
처럼 되어있다면
UA에서 GA4 연동 해봤자 데이터 공유가 안된다!

------------------
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src='https://www.googletagmanager.com/gtag/js?id=UA-1234????-1'></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'UA-1234????-1');
    </script>
------------------
처럼 gtag 로 설정되어있어야
UA -> GA4 로 데이터 공유가 된다!!!

물론 
        gtag('config', 'G-1234????');
처럼 추가로 GA4를 넣어도 된다. (연동 안했다면)

댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -
목록형 📷 갤러리형
제목
[기본형] HTML (with 부트스트랩5.3 , jquery 3.7, vue.js)
유용한 리눅스(LINUX) 명령어
[공지] 기술 게시판
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.9
6.10
6.11
6.12
6.13
6.14
6.15
6.16
6.17
6.18
6.20
6.21
6.22
6.24
6.25
6.26
6.27
6.28
6.29
6.30
7.1
7.2
7.3
7.4
7.5