2010-02-06 2 views
3

Google 애널리틱스에서 거래를 추적하는 데 문제가 있습니다. 주문 확인 페이지에서 생성하는 코드는 다음과 같습니다.Google 애널리틱스에서 거래를 추적하지 않음

이 중 하나를 디버깅하는 방법을 모르겠다. Google js에서 오류 코드를 가져 오는 방법에 대한 정보를 찾을 수 없습니다. 내가 할 수만 있다면 방화범의 콘솔에서 실행할 것입니다. 이 시점에서 나는 진행하는 방법에 붙어있다.

<script type="text/javascript"> 
    var _gaq = _gaq || []; 
    _gaq.push(['_setAccount', 'UA-########-#']); 
    _gaq.push(['_setDomainName', '.mydomain.com']); 
    _gaq.push(['_trackPageview']); 


    _gaq.push(['_addTrans', 
     '117',   // order ID - required 
     'StoreName.com', // affiliation or store name 
     '35.96',   // total - required 
     '0',   // tax 
     '0',    // shipping 
     '',  // city 
     '',  // state or province 
     ''    // country 
    ]); 
    _gaq.push(['_addItem', 
     '117',   // order ID - required 
     '1',   // SKU/code - required 
     '1 Pack',  // product name 
     'Catagory5',   // catagory 
     '35.96,   // unit price - required 
     '1'    // quantity - required 
    ]); 
    _gaq.push(['_trackTrans']); 

    (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'; 
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga); 
    })(); 
</script> 

주셔서 감사합니다.

+1

단가 이후 오타가 발견되었습니다. – reconbot

답변

3

Google 코드의 this page을 확인하십시오. 그것은 당신이하고자하는 것을 보여주는 예입니다.

+0

Google의 최신 비동기 메소드를 사용하고 있지만 아이디어는 같습니다. 나는 현재 그 페이지에서 요구되고 나열된 3 단계를 수행하고있다. – reconbot

+0

코드가 Google 예제와 비교해 잘 보입니다. 전자 상거래 추적을 설정 했습니까? : +) 또한 비동기 코드가 작동 했습니까? –

+0

나는 그것을 교환하고 점검 할 것이다. – reconbot

관련 문제