2012-10-09 2 views
0

최근에 내 웹 사이트의 Google Analytics 추적 코드 중 하나를 최신 (비동기) 버전으로 업데이트했습니다. 그렇게 한 이후로 링크를 올바르게 추적하지 못합니다. 들어오는 링크에서 지정한 Analytics utm 매개 변수 (예 : 키워드, 소스, 캠페인 등)를 가져 오는 대신 모든 링크가 추천으로 처리됩니다.Google Analytics가 올바르게 추적되지 않음

Google 맞춤 검색 엔진을 사이트에 추가했습니다. 위의 문제 아무것도

<script type="text/javascript"> 

    var _gaq = _gaq || []; 
    _gaq.push(['_setAccount', 'UA-XXXXXXXXX-X']); 
    _gaq.push(['_setDomainName', 'sitedomain.com']); 
    _gaq.push(['_trackPageview']); 

    (function() { 
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 
    })(); 

</script> 
<script type="text/javascript"> 
    (function() { 
    var cx = '0000000000000000:aksjfhkjw'; 
    var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; 
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + 
     '//www.google.com/cse/cse.js?cx=' + cx; 
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); 
    })(); 
</script> 

있습니까 : 여기에 어떤 코드 (가짜 계좌 번호를 사용하는 등) 샘플은 오른쪽 페이지 (웹 로그 분석 및 CSE 코드)에 닫는 헤드 태그 앞에가요? 예를 들어, 같은 페이지에 cse가 있으므로 어떤 방식 으로든 일반 Analytics 스크립트를 수정해야합니까?

도움 주셔서 감사합니다.

답변

0

나는 당신의 코드가 옳다고 생각하지 않는다. 여기

내가 Google 웹 로그 분석 코드를 사용하고 무엇을 :

<script type="text/javascript"> 

     var _gaq = _gaq || []; 
     _gaq.push(['_setAccount', 'UA-xxxxxxxxxx']); 
     _gaq.push(['_trackPageview']); 

     (function() { 
     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 
     })(); 

    </script> 

나는 우리의 도메인 사이트 검색을 해달라고하지만이 GA에 데이터를 얻을 확실히 충분하다. _gaq.push(['_setDomainName', 'sitedomain.com']);이 추천으로 읽혀질 수 있습니다. 시도해보고 알려줘.

관련 문제