【问题标题】:Google Analytics iframe+query string trackingGoogle Analytics iframe+查询字符串跟踪
【发布时间】:2013-08-17 01:12:33
【问题描述】:

我想知道是否有人能指出我正确的方向?

我在 us.website.com 上有一个 iframe,嵌入在 www.website.com 的页面中 - 我需要在谷歌分析中跟踪 us.website.com 页面的每个查询字符串。

我将查询字符串数据从 URL(地址栏)传递到 iframe,因此当提交表单时,跟踪代码会识别用户来自哪里。

www.website.com/offers/offer.html?src=source1(表单将source1作为入口源) www.website.com/offers/offer.html?src=source2(表单通过source2作为入口源)

目前,所有 (us.website.com/offers/offer.asp) 统计信息都显示在这个 .asp 页面下 - 但我需要它来显示每个查询字符串的统计信息。

us.website.com/offers/offer.asp?src=source1 - 个人统计 us.website.com/offers/offer.asp?src=source2 - 个人统计数据

有没有办法做到这一点,而无需在 us.website.com 域上构建两个单独的 .asp 页面??

提前致谢!

【问题讨论】:

    标签: google-analytics query-string multiple-domains


    【解决方案1】:

    最简单的方法是在 GA 面板中create view(过滤数据)。当然,您可以告诉 GA 跟踪每个页面上的不同 URL,具体取决于解析的 source,但您正在重新发明轮子,请使用 filters

    var url = '/someofakename.asp?ada'
    try {
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-XXXXXXXXX-Y']);
        _gaq.push(['_trackPageview', url]);
    } catch(err) {
     //handle errors
    }
    

    【讨论】:

    • 我应该指出我只有 us.website.com 域的 Google Analytics 访问权限,而不是 www.website.com。
    • 如果您将过滤器字段设置为“请求 uri”,条件设置为“包含”并输入您的查询参数作为值,则过滤器(和段)应该可以工作 - 如果我理解正确,则查询参数通过到 iframe url,所以它会显示在请求 uri 中。
    • 谢谢,我今天试试看。
    猜你喜欢
    • 2015-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多