Welcome to WebmasterWorld Guest from 54.144.107.83

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

how to use GA virtual pageview tracking?

google analytics virtual pageview

     
6:05 am on Jul 2, 2010 (gmt 0)

New User

5+ Year Member

joined:Apr 19, 2010
posts:20
votes: 0


when i add a segment of code to track a event, say download, must i place the whole google analytics code before where i call "_trackPageview"?
I mean, should i do exactly like below?
<body>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write( unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-accountcode-6");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._initData();
pageTracker._trackPageview();
</script>


<a href="movie.avi" onclick="javascript: pageTracker._trackPageview("/download/movie.avi");">download movie</a>


</body>
8:12 am on July 2, 2010 (gmt 0)

New User

5+ Year Member

joined:July 2, 2010
posts:2
votes: 0


I think so