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}}
    -
제목 작성자 날짜
공대여자
공대여자
mins01
공대여자