google-analytics-api

Data api ga, how to get data for multiple pages?

妖精的绣舞 提交于 2019-12-08 02:04:28
问题 I'm using Data api of google to get data in my filters, I'm getting data for page path for single page and I'm stuck at multiple pages. I followed document and passed following query to filters, $filter = 'ga:pagePath=~/about_us.htm,ga:pagePath=~/index.htm'; Is there anything wrong in it? Can someone please help in it. 回答1: You need to add $dimensions='ga:pagePath' to individually query the two pages. 回答2: I don't see anything wrong with it but it's always good to run your data api calls

Google Developers Console: how do I register a new application?

主宰稳场 提交于 2019-12-08 02:04:01
问题 I'm trying to follow this tutorial for Google's Analytics API. The tutorial says "If you haven't already registered your application with the Google Developers Console, then set up a project and application in the Developers Console". The documentation for the Developers Console says "A project consists of a set of applications...", which makes sense. I'm able to create the project, but I don't see any way to create an application within that project. Both pieces of documentation linked above

Uncaught TypeError: Cannot read property 'sub' of null in Google Analytics API

一曲冷凌霜 提交于 2019-12-08 01:41:09
问题 i created one application which uses google analytics api ie https://apis.google.com/js/client.js?onload=load and i was using nicely but suddenly now one error is coming Uncaught TypeError: Cannot read property 'sub' of null after popup comes for username and password, it was working fine before but now it is showing this error. can anyone please help me out with this. Thanks, Mayank 回答1: This is a bug in the Google API Javascript Client, and my production site is being affected as well. A

Get function in Google Analytics API

半城伤御伤魂 提交于 2019-12-07 23:57:55
问题 I'm trying to fetch some data using the analytics API, the example i have is this: function getResults(&$analytics, $profileId) { // Calls the Core Reporting API and queries for the number of sessions // for the last seven days. return $analytics->data_ga->get( 'ga:' . $profileId, '7daysAgo', 'today', 'ga:sessions'); } and the function in the Analytics.php file is: public function get($ids, $metrics, $optParams = array()) { $params = array('ids' => $ids, 'metrics' => $metrics); $params =

Google Analytics API not returning same data as Analytics dashboard

狂风中的少年 提交于 2019-12-07 15:44:45
问题 I'm trying to write a Google Analytics API query that simply returns the monthly unique visitors for each month over the last year. This is the data I see in the Google Analytics dashboard. I've used the Analytics API explorer to write the query, I've verified the ID and account is authed correctly. I'm using the ga:month dimension to get the data month-by-month. This is the query, and the resultant data These numbers are nothing at all like the ones I see on the Analytics dashboard. This is

Best API to display Google Analytics data in my Admin panel with Codeigniter PHP?

我的未来我决定 提交于 2019-12-07 15:26:25
问题 There are a lot of results on Google for this, but most of them are old more than an year. I simply want to display some nice charts with jQuery in my admin with visits per day, most visited pages with number of visits, etc. I don't want to store the data for the visits in my database, the one at Google Analytics is perfect :) 回答1: Have a look at gapi-google-analytics-php-interface. The code has many examples which should be useful for you. The code has not been updated in a while, so you

Measurement Protocol Events Showing Up In GA Real-Time Dashboard but not Content Dashboard

喜夏-厌秋 提交于 2019-12-07 13:38:24
问题 I am sending events to Google Analytics using Measurement Protocol. For a while (few days) these seemed to be showing up fine in both the Real-Time area of the Google Analytics Website and the Content->Events->Overview. Now, they are still showing in the Real-Time page but the Content->Events->Overview shows no activity for over 5 days. Would appreciate any ideas. Surely if they are showing up in Real-Time it shows that they are being correctly sent to the system? 回答1: I think I answered my

Google Analytics embed api not working on Angular 2 app

泄露秘密 提交于 2019-12-07 08:42:34
I am using the following code to embed Google Analytics api into my Angular 2 app: Mycomponent.html <div id="embed-api-auth-container"></div> <div id="chart-container"></div> <div id="view-selector-container"></div> <script> gapi.analytics.ready(function() { /** * Authorize the user immediately if the user has already granted access. * If no access has been created, render an authorize button inside the * element with the ID "embed-api-auth-container". */ gapi.analytics.auth.authorize({ container: 'embed-api-auth-container', clientid: My-Client-Id }); /** * Create a new ViewSelector instance

Inserting Google Analytics Content Experiments using the Node.JS Client Library

房东的猫 提交于 2019-12-07 08:40:50
问题 I'm trying to configure a content experiment using the Node.js Client Library, and have not been able to work out the syntax. Where do I put the body (an Experiment resource) as described here? https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtExperimentsGuide#insert This code, for listing existing experiments, works as expected: var listExperiments = function(){ googleapis .discover('analytics', 'v3') .execute(function(err, client) { var request = client .analytics

Profiling the Performance of a Google App Script

旧城冷巷雨未停 提交于 2019-12-06 19:20:54
问题 I've written a Google App Script to pull in Google Analytics data into a Google Spreadsheet. It's a fairly long running script making multiple requests to the GA Reporting API, it also uses Google App's ScriptDB. Is there a good way of profiling each step of the scripts performance so I can figure out what areas are taking the longest, so I can begin optimizing in certain areas? 回答1: The Execution Transcript is very useful for this kind of thing. You can also put Logger.log() statements all