var SidebarPosts_Ga_Popular = {new_Id:''}; //console.log(SidebarPosts_Ga_Popular.num); var popular_post_ga = function (CurrentPost_Id,num,CatTitle,RelatedPostTiltle,RelatedPostId,PostUrl,Type){ if(CurrentPost_Id != SidebarPosts_Ga_Popular.new_Id ){ SidebarPosts_Ga_Popular.new_Id = CurrentPost_Id ; } //return ''; if (typeof(_gaq) != 'undefined') { _gaq.push(['_trackEvent','文章', CatTitle+lazyloadID+'_'+'SidebarPosts_ButtonClick_'+ CurrentPost_Id + '_第'+ num +'篇_'+Type,RelatedPostTiltle,RelatedPostId]); window.location.href = PostUrl; return; } if (typeof(__gaTracker) != 'undefined') { __gaTracker('send','event','文章', CatTitle+lazyloadID+'_'+'SidebarPosts_ButtonClick_'+ CurrentPost_Id + '_第'+ num +'篇_'+Type,RelatedPostTiltle,RelatedPostId); window.location.href = PostUrl; return; } if(typeof(_gaq) == 'undefined' && typeof(__gaTracker) == 'undefined' ){ window.location.href = PostUrl; return; } } var SidebarPosts_Popular = {new_Id:'',num:'1'}; var lazyloadID = 0; var SidebarPosts = function (id,currentPost_Id,cat_title,num,type){ // console.log(currentPost_Id); // console.log(currentPost_Id,lazyloadID,window.SidebarPosts_Popular.new_Id ); if(currentPost_Id != SidebarPosts_Popular.new_Id && typeof(SidebarPosts_Popular.new_Id) != "undefined"){ SidebarPosts_Popular.new_Id = currentPost_Id ; lazyloadID = ++lazyloadID ; } // console.log(lazyloadID); jQuery('#'+id).attr("data-action", function(){ return ""+cat_title+"_"+lazyloadID+"_SidebarPosts_ButtonClick_"+currentPost_Id+"_第" + num + "篇_"+type; }) }