소스
if("2".equals(TYPE)) {
result = "<a href=\""+ LINK_SRC + "\" target=\"_blank\" onClick=\"recordOutboundLink(this, '" + ID + "','" + NAME + "'" + ");return false;\">" + TEXT + "</a>";
// banner
} else {
result = "<a href=\""+ LINK_SRC + "\" target=\"_blank\" onClick=\"recordOutboundLink(this, '" + ID + "','" + NAME + "'" + ");return false;\"><img src=\"" + IMG_SRC + "\"></a>";
}
여기에서 ID 와 네임은( 카테고리, 엑션 ) 추후에 google analytics 에서 보기 쉽게하기위해 설정
구글 설치(해더 이거나 아니거나 상간업음)
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26953161-1']);
_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);
})();
function recordOutboundLink(link, category, action) {
try {
var myTracker=_gat._getTrackerByName();
_gaq.push(['_trackEvent', category , action]);
if (link.target == '_blank') {
window.open(link.href);
} else {
setTimeout('document.location = "' + link.href + '"', 100)
}
}catch(err){}
}
</script>
http://www.google.com/support/googleanalytics/bin/answer.py?answer=55527&hl=ko
댓글 없음:
댓글 쓰기