Tag: 谷歌分析

如何获取用户浏览统计信息?

此问题与获取Google代码管理器收集的用户数据相关联,以使其更具体。 我有一个Ruby-on-Rails Web应用程序。 假设有些用户来到我的网站,浏览几页,然后通过反馈表向我发送反馈。 有没有办法收集这样的信息,如: 哪些关键字将用户引导到我的网站 他在我的网站上访问了哪些页面以及访问了多长时间 任何其他冲浪统计数据,这可能很有趣 为了与此反馈一起发送? 我有一个Google跟踪代码管理器收集此类信息,但它会自动发送到我的Google帐户,但我无法找到任何API来获取反馈信息。

在我的Rails应用中包含Google Analytics嵌入API第三方信息中心示例javascript

我在这里关注Google Analytics嵌入API这个例子,通过我的应用程序中的Chart.js实现GA第三方仪表板,我在Step 3遇到麻烦,我们将包括所有的javascript库。 我能够在我的application.js加载Embed API (function(w,d,s,g,js,fs){ g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q.push(f);}}; js=d.createElement(s);fs=d.getElementsByTagName(s)[0]; js.src=’https://apis.google.com/js/platform.js’; fs.parentNode.insertBefore(js,fs);js.onload=function(){g.load(‘analytics’);}; }(window,document,’script’)); //= require /public/javascript/Chart.min.j //= require /public/javascript/moment.min.js //= require /public/javascript/embed-api/date-range-selector.js //= require /public/javascript/embed-api/active-users.js 它在开发工具的Networks部分显示cb=gapi.loaded_0正在加载。 但是,其他库不是。 Charts.min.js和Charts.min.js可在线获取,但我不确定在哪里可以找到embed-api/date-range-selector.js或者embed-api/active-users.js来检索到我的应用程序? EDIT1在这里找到文件: https : //github.com/googleanalytics/ga-dev-tools

在Rails中捕获UTM参数

我试图在URL中捕获UTM Params以将Source,Campaign等添加到用户帐户。 可悲的是,我似乎无法弄清楚如何捕获这些参数。 据我所知,我遵循博客文章http://www.matthuggins.com/articles/tracking-new-user-registrations-by-source-search-terms 所以,在我的应用程序控制器中我有以下内容 ApplicationController.class_eval do before_filter :capture_referrer protected def capture_referrer session[:referrer] = request.env[‘HTTP_REFERER’] if !session[:referrer] end end 在用户控制器中创建Action @user.referrer = session[:referrer] 在USer模型中: def set_traffic_source if self.referrer url = URI.parse(self.referrer) self.source ||= uri.host.downcase.gsub(/^www\./, ”) self.traffic_keywords ||= search_termins(uri) end end 这一切都很好,为了捕捉引用者 – 但我实际上想要读出URI传入的UTM。 我怎么会这样呢?

如何提取Google Analytics统计信息?

Google API Ruby客户端是最佳选择吗? 我有一个网站example.com和用户,我希望他们在example.com上看到他们的谷歌分析统计数据,我该怎么办? 我可以看到这个例子,但我无法弄清楚如何开始。

Rails,存储Google Client API的JSON凭据以及如何访问它的位置?

在我的Google Developer Console中,我已下载了凭据json文件。 它看起来像这样: client_secret-000000000-aaaaaaaaaa0a.apps.googleusercontent.json 我想使用google-api-client获取ruby。 我需要在什么文件夹中放置这个json文件? 另外,我该如何访问它? 所有关于此的教程都会跳过它。

Ruby实时谷歌分析API

我试图通过google-api-ruby-client获得activeVisitors。 客户端在此处列出了实时谷歌分析API文档,但我在文档中没有看到任何关于将其用于实时API的文档。 我看到函数discovered_api但是我没有看到API名称的posisble参数列表。 常规分析API示例: # Get the analytics API analytics = client.discovered_api(‘analytics’,’v3′) 有谁知道如何使用此客户端来获得实时活跃的访问者? 这是我尝试使用的代码: require ‘google/api_client’ require ‘date’ # Update these to match your own apps credentials service_account_email = ‘xxxxxxxxxxxxx@developer.gserviceaccount.com’ # Email of service account key_file = ‘/path/to/key/privatekey.p12’ # File containing your private key key_secret = ‘notasecret’ # Password to unlock private key profileID = […]

Google AnalyticsAPI错误“无法一起查询所选维度和指标。”

我必须从我的GA电子商务中检索尽可能多的不同指标。 我正在使用谷歌api ruby​​客户端。 并继续收到错误: “message”=>”Selected dimensions and metrics cannot be queried together.” 例如,对于此请求: result = client.execute(api_method: api_method.data.ga.get, parameters: { ‘ids’ => ‘ga:95561781’, ‘start-date’ => Date.new(2006,1,1).to_s, ‘end-date’ => Date.today.to_s, ‘dimensions’ => ‘ga:source,ga:medium,ga:country,ga:transactionId,ga:affiliation,ga:productSku,ga:productName’, ‘metrics’ => ‘ga:sessions,ga:transactionRevenue,ga:transactions,ga:uniquePurchases,ga:totalValue,ga:transactionTax’ }) 我如何知道我可以结合哪些请求指标和维度? 我怎样才能检索尽可能多的数据?