We're having an issue with Virtual Pageviews not being recorded in Analytics.
We have the following tracking code at the bottom of the page (not the async version)
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-3']);
_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);
})();
</script>
And for the individual virtual pages we're trying to track we have the following co开发者_如何转开发de:
$(".contact_sub a").click(function ()
{
//instantiate it
var pageTracker = _gat._getTracker("XX-XXXXXXXX-1");
//get company name
var companyName = $(this).parents(".resultContainer").find("H2").text();
//track this click event as a page view
pageTracker._trackPageview("/click-tracking/company/" + companyName + ".html");
$(".window_" + $(this).attr("rel")).dialog({
modal: true,
width: "350px"
});
return false;
});
In Firebug NET tab we can see the correct call be sent out to google and the Image is returned. The parameters being sent out are right too.
Problem is nothing is showing up in Analytics. We've done this for another project and it worked just fine. I just noticed now that in the two lines that deal with getting an instance of the tracker there's one tiny difference and that's the last number. One is a 1 and the other is a 3. Not sure why that is that way.
Any help would be great.
Thanks Jacques
The getTracker needs your website ID, as specified in google analytics. They should be the same basicly, those pageview are now being registered at another website. So just change the 3 in a 1.
精彩评论