gabba gem无法跟踪不同的域 [英] gabba gem not tracking different domains

查看:79
本文介绍了gabba gem无法跟踪不同的域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个连接到以下域的UA帐户: http://www.mytestdomain.com ,其帐户ID为UA-123456-1

I have a UA account which is connected to the following domain: http://www.mytestdomain.com with the following account id UA-123456-1

当我使用Gem跟踪域名时,效果很好:

When i am using the Gem to track the domain it works well:

Gabba::Gabba.new('UA-123456-1', 'http://www.mytestdomain.com', user_agent).page_view('index', 'index.html')

但是无法跟踪其他域:

Gabba::Gabba.new('UA-123456-1', 'http://www.notmydomain.com', user_agent).page_view('index', 'index.html')

我还应该如何跟踪其他域?

What should i do to track others domains as well ?

相关:事件使用Gabba发送到Google Analytics(分析)的主机名没有

推荐答案

而不是使用主机名" http://www. notmydomain.com ",则您可能应该使用request.host.所以:

Instead of using the hostname "http://www.notmydomain.com" you should probably be using request.host. so:

Gabba::Gabba.new('UA-123456-1', request.host, request.user_agent)
            .page_view('index', request.fullpath)

如果您仍然无法查看主机名,请确保没有任何过滤器可以过滤掉Google Analytics(分析)中的内容.

If you still have problems seeing the hostname, make sure you don't have any filters filtering out the content in Google Analytics.

还可以查看 GabbaGMP ,它使编码变得更简单了,并且还允许您进行地理跟踪,这是Gabba不允许的(当前不支持电子商务分析)

Also have a look at GabbaGMP, it makes it a little simpler in terms of coding, and also allows you to do geo tracking, which Gabba doesn't allow (doesn't currently support eCommerce analytics)

这篇关于gabba gem无法跟踪不同的域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆