2012-12-05 2 views
2

직장에서는 IP로 내부 트래픽을 제외하면 Google에서 작동하지 않습니다. 사용자 브라우저에 사용자의 트래픽을 제외하도록 Google 애널리틱스에 알려주는 쿠키를 설정해야합니다 이 쿠키가 설치된 상태로Google 웹 로그 분석의 내부 트래픽 제외

우리가 사용하는 쿠키는 다음과 같습니다

<body onLoad="javascript:_gaq.push(['_setVar','me_exclude']);">

이 쿠키에 연결되지 않은 페이지/전에, 그래서 그것이으로부터 자신을 제외 아는 사람이 될 것입니다 방문 할 수있는 유일한 사람 Google 웹 로그 분석.

내가 방황하고있는 것은 제외 쿠키가 작동하려면이 페이지에 추적 코드를 포함시켜야하거나, 무엇보다도 필요한 라인입니까?

+2

구글 기업에 플러그인을 선택 배포 할 더 나은 : https://tools.google.com/dlpage/gaoptout 그것에 대해 –

+0

감사, 그 중 하나 찾고있는 필자 시대를 위해 단지 크롬 plugins를 발견 할 수 있었고, 모든 파이어 폭스이었다. 건배 – sam

+0

IP로도 가능합니다. https://support.google.com/analytics/answer/1034840?hl=ko – TomFuertes

답변

0

는 거의 응답에 대한 검색 포기하지만, 다음이 발견 https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#optout

1) 귀하의 사이트에 자신 더미 페이지를 확인합니다. 예를 들어 : www.yourdomain.com/exclude-traffic.html

2) "noindex, nofollow와"< 메타 이름 = "로봇"내용 =에 추가 머리에 >, 그래서 페이지가 늘 색인.

3) 추적 태그 위에 head 태그 안에 스크립트를 추가하십시오. UA-XXXXXXXX-Y 값을 업데이트해야합니다. 관리 -> 추적 정보 -> 추적 코드에서 GA 코드를 확인할 수 있습니다.

4) body 태그 안에 링크를 추가하십시오.

5) 페이지를 열고 링크를 클릭하십시오.

최종 결과 :

<!DOCTYPE html> 
    <html lang="en"> 
    <head> 
     <title>Remove My Internal Traffic from Google Analytics</title> 
     <meta name="robots" content="noindex, nofollow"> 
     <script> 
      // Set to the same value as the web property used on the site 
      var gaProperty = 'UA-XXXXXXXX-Y'; 

      // Disable tracking if the opt-out cookie exists. 
      var disableStr = 'ga-disable-' + gaProperty; 
      if (document.cookie.indexOf(disableStr + '=true') > -1) { 
       window[disableStr] = true; 
      } 

      // Opt-out function 
      function gaOptout() { 
       document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/'; 
       window[disableStr] = true; 
      } 
     </script> 
     <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','//www.google-analytics.com/analytics.js','ga'); 

      ga('create', 'UA-XXXXXXXX-Y', 'domainname.com'); //now its changed to auto 
      ga('send', 'pageview'); 
     </script> 
    </head> 
    <body> 

    <h1>Remove My Internal Traffic from Google Analytics</h1> 
    <p><a href="javascript:gaOptout()">Click here to opt-out of Google Analytics</a></p> 

    </body> 
    </html> 
관련 문제