Total members 11894 |It is currently Thu Nov 21, 2024 10:27 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





How to track clicks on hash links from Google analytics
javascript code
<html>
<head>
<title>Follow clicks on hash links </title>

<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>


<script>
$(document).ready(function(){
//
// Track clicks on hash links using Google analytics.

function loadOnClick() {

$('a#hashLink').each(function(){

$(this).attr("onclick", "_gaq.push(['_trackPageview'," +
"location.pathname + location.search + jQuery(this).attr('rel')]);" );
});
}
loadOnClick();
});
</script>
</head>
<body>

</div>
<a href="#hash" rel="contact" id="hashLink" >Follow me.</a>
</body>
</html>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : How to track clicks on hash links from Google analytic
 get time difference between to mouse-clicks-double clicks     -  
 Can i track calls from mobile phones     -  
 queue of objects keep track of the front and rear     -  
 track session from login page-J2EE project     -  
 show the locations of clicks on the image     -  
 draw any number of lines on mouse clicks     -  
 draw any number of circles using mouse clicks     -  
 avoid multiple submit clicks using javascript     -  
 Applet get mouse clicks and draw circle     -  
 Draw Cardinal Spline With Mouse Clicks Points     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com