Google Analytics 虚拟综合浏览量未记录

发布于 2024-12-01 15:51:15 字数 1498 浏览 1 评论 0原文

我们遇到了虚拟综合浏览量未记录在分析中的问题。

我们在页面底部有以下跟踪代码(不是异步版本)

<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>

,对于我们尝试跟踪的各个虚拟页面,我们有以下代码:

 $(".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;
            });

在 Firebug NET 选项卡中,我们可以看到正确的调用被发送到谷歌并返回图像。发送出去的参数也是正确的。

问题是分析中没有显示任何内容。我们已经为另一个项目做到了这一点,效果很好。 我现在刚刚注意到,在处理获取跟踪器实例的两行中,有一个微小的差异,那就是最后一个数字。一个是 1,另一个是 3。不知道为什么会这样。

任何帮助都会很棒。

谢谢 雅克

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 code:

 $(".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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静赏你的温柔 2024-12-08 15:51:15

getTracker 需要您的网站 ID,如 Google Analytics 中指定的那样。它们基本上应该是相同的,这些浏览量现在正在另一个网站上注册。所以只需将 3 改为 1 即可。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文