나는 this을 사용하고 있으며, 아웃 바운드 링크를 추적하고 있습니다.하지만 내 페이지를 유효하게하고 싶습니다. HTML은 Google Analytics를 통해 아웃 바운드 링크를 추적하는 유효한 방법입니까?
이
내가 점점 오전 오류입니다 : 더 "OnCick"속성이 없습니다HTML은 다음과 같습니다
<p>View some of our student produced videos
on <a href="http://www.youtube.com/user/johndoe" onClick="javascript: pageTracker._trackPageview('/outgoing/youtube.com/user/johndoe');" rel="external">YouTube!</a></p>
내가, 내 자바 스크립트 삽입 파일이 추가 된 모든 외부 링크를 추적 :
$(document).ready(function() {
$('a[href^=http]:not("[href*=://' + document.domain + ']")').click(function() {
pageTracker._trackPageview('/out/'+$(this).attr("href"));
});
});
이제 내 js 소스 파일은 아래처럼 보입니다. 나는 두 조각의 시작 부분에 (문서) .ready (함수() {$ 전화 통지, 그들 모두는 온 클릭을 처리하기 위해 하나? event listener
$(document).ready(function() {
// opens links into separate window
$('A[rel="external"]').click(function() {
window.open($(this).attr('href'));
return false;
});
});
$(document).ready(function() {
$('a[href^=http]:not("[href*=://' + document.domain + ']")').click(function() {
pageTracker._trackPageview('/out/'+$(this).attr("href"));
});
});
doctype은 무엇입니까? –