google-analytics-api

Google API + proxy + httplib2

孤人 提交于 2019-12-22 05:25:28
问题 I'm currently running a script to pull data from Google Analytics with googleapiclient Phyton package (that is based on httplib2 client object) --> My script works perfectly without any proxy. But I have to put it behind my corporate proxy, so I need to adapt my httplib2.Http() object to embed proxy information. Following httplib2 doc1 I tried: pi = httplib2.proxy_info_from_url('http://user:pwd@someproxy:80') httplib2.Http(proxy_info=pi).request("http://www.google.com") But it did not work. I

Ajax API calls in loop need to be executed in order

末鹿安然 提交于 2019-12-22 01:12:23
问题 lets say you have a scenario where you needed to create a .csv output in a page's textarea... So I have an array of queries which i loop. Inside the loop im passing a query to an ajax call... I need to append the result of the ajax call into the textarea. My question is how do you get the results printed out in the order they are requested (basically the order in the queries array) //example array to loop. var queries= ['query1', 'query', 'query3', 'query4']; //the textarea where im going to

Google oAuth2 tokens invalidated more and more

不打扰是莪最后的温柔 提交于 2019-12-21 21:13:22
问题 I have a web app built on oAuth2 that has been in production for 5+ years. Users Authenticate and Authorize with Google and grant my application access to the Google Analytics data. All of a sudden I am seeing a surge in failures when refreshing my users oAuth2 tokens. This is the call: https://accounts.google.com/o/oauth2/token Passing these parameters: client_id=xxyyzz client_secret=xxyyzz grant_type=refresh_token refresh_token=xxyyzz This seems to be be on accounts that are less active (i

When is a Google Analytics Entrance not a Visit?

风流意气都作罢 提交于 2019-12-21 20:27:38
问题 In this question, the accepted answer says that a visit is not always an entrance. I checked and it's true for my site, though the difference is small (0.4% difference). difference between ga:entranceBounceRate and ga:visitBounceRate When is a visit not an entrance? 回答1: Visits are incremented with the first hit of a session, whereas Entrances are incremented with the first Pageview hit of a session. So if the first hit of the visit is not a Pageview then you might see a difference between

Node: Google Analytics data via service account

戏子无情 提交于 2019-12-21 05:57:09
问题 Update: I've since turned the code into an NPM module. I've worked my way through created a JWT token for a service account, and I can access user data, but I want to get to my analytics data to use it to drive content on my website. Note: I don't know if there is a better way than this, but the the existing npm tools seem to require that you enter your password. As a result I end up using REST calls rather the gapi tools. This is the error I get { error: { errors: [ [Object] ], code: 403,

Google Analytics API v4 for Android Does NOT Send Screen Views

醉酒当歌 提交于 2019-12-20 12:28:00
问题 I've set all things for google analytics api v4 as it mentioned here: https://developers.google.com/analytics/devguides/collection/android/v4/ and here: http://www.javacodegeeks.com/2014/04/working-with-google-analytics-api-v4-for-android.html I can see real time data but i could NOT see Screens, Active Users,New Users and Top Device Models in specific time period such as "All Time". Analytic does not send screen views. Here is my global_tracker.xml <string name="ga_trackingId">UA-XXXXXXXX-Y<

Query Google Analytics by User ID

…衆ロ難τιáo~ 提交于 2019-12-20 09:52:35
问题 Is there a way to query results using the Core Reporting API (v3) and filtering those results by the User ID assuming that it is being sent to Google Analytics properly? I've googled this question a lot and read a whole bunch of articles but I did not find one place that does that. Moreover, the fact that I cannot see the User ID anywhere in the reporting interface makes me doubt that this is even possible. I'm guessing I will have to dome something similar to what is recommended here in

How to revoke an authentication token client side against the Google Api

心已入冬 提交于 2019-12-20 04:27:06
问题 I am trying to revoke a token using the Google Api client side code. My code looks something like this: $.get("https://accounts.google.com/o/oauth2/revoke?token=" + accessToken, function () { window.location.reload(); }); And I am getting the following error? XMLHttpRequest cannot load https://accounts.google.com/o/oauth2/revoke?token=tokenishere Origin http://balblabla.com is not allowed by Access-Control-Allow-Origin. 回答1: After some research I found out that you can get around the cors

Pulling Google Analytics Multi Channel Funnel data via API

只谈情不闲聊 提交于 2019-12-20 03:26:17
问题 I am trying to pull the multi-channel funnel reports from the Google Analytics API and am getting the following error: Invalid value 'mcf:source'. Values must match the following regular expression: '(ga:.+)?' Here is the code I am using, it works fine when the dimensions & metrics are from the ga:... family, but for some reason it won't let me pull mcf: reports. $analytics = new Google_Service_Analytics($client); $analytics_id = 'ga:XXXXXXXX'; $lastWeek = date('Y-m-d', strtotime('-26 day',

Google Analytics API Returning 401 On Example Code

為{幸葍}努か 提交于 2019-12-20 03:15:16
问题 I am attempting to retrieve the data from our content experiments from google analytics... I am using the following code, my creds are good, and have been censored for this post... <?php require_once 'Google/Client.php'; require_once 'Google/Service/Analytics.php'; session_start(); $client = new Google_Client(); $client->setApplicationName('Hello Analytics API Sample'); // Visit https://cloud.google.com/console to generate your // client id, client secret, and to register your redirect uri.