google-analytics-api

Analytics Reporting API V4 Client Library for .NET

筅森魡賤 提交于 2019-11-29 20:17:37
I'm trying to get some data from our google analytics instance and I'd like to use the Analytics Reporting API V4 Client Library for .NET ( https://developers.google.com/api-client-library/dotnet/apis/analyticsreporting/v4 ) so that I can bake some of this data into an administration site we have built. I'm having trouble finding any examples of using this code and the documentation seems to be incredibly sparse. I would like to use a service account to authorize as we only need to view data associated with the analytics account which we control. If anyone could provide some sample code or

Google Analytics API V3 / OAuth 2

喜夏-厌秋 提交于 2019-11-29 18:54:33
问题 I've desperately tried to figure this out on my own, and did not want to come to SO with this question, but I'm at my wits end (no thanks to the api / oauth docs). I'm working in PHP and I'm trying to avoid using the Google_Client and AnalyticsService classes, by using REST on the analytics.data.ga.get method. STEP #1: Create an API Project for a Web Application I go to the api console and create a project with analytics services and get an OAuth Client ID and Secret. I'm under the impression

Service Applications and Google Analytics API V3: Error 101 (net::ERR_CONNECTION_RESET)

匆匆过客 提交于 2019-11-29 15:28:06
I'm trying to get some info of my Google Analytics account using PHP. I already followed the steps for creating a Service Account in the Google Console API in this answer . I'm using the Google API Client for PHP . This is the code I've got so far: <?php $path_to_src = 'src'; // These files are in /src, upload its contents to your web server require_once $path_to_src . '/Google_Client.php'; require_once $path_to_src . '/contrib/Google_AnalyticsService.php'; $path_to_keyfile = '***'; //my private key // Initialise the Google Client object $client = new Google_Client(); // Your 'Product name'

GAPI is Shutting Down Need A Lightweight PHP API for Google Analytics

笑着哭i 提交于 2019-11-29 15:18:10
问题 This is the question for GAPI users which shut down yesterday: https://code.google.com/p/gapi-google-analytics-php-interface GAPI - Google Analytics API PHP Interface was a simple yet powerfull Google Analytics library. It was using the old API and required full Google username and password which was really old fashioned but it was working like a charm. bUT here we are, our GAPI based codes gives the message: Failed to authenticate user AuthForInstalledApps The only option is to use the

Use Google Analytics for data to display on our webpage?

我只是一个虾纸丫 提交于 2019-11-29 10:45:51
On some of our pages, we display some statistics like number of times that page has been viewed today, number of times it's been viewed the past week, etc. Additionally, we have an overall statistics page where we list the pages, in order, that have been viewed the most. Today, we just insert these pageviews and event counts into our database as they happen. We also send them to Google Analytics via normal page tracking and their API. Ideally, instead of querying our database for these stats to display on our webpages, we just query Google Analytics' API. Google Analytics does a FAR better job

API for historical traffic data? [closed]

こ雲淡風輕ζ 提交于 2019-11-29 09:33:16
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Does anyone know of a public API for historical traffic data? Some quick googling pulls up an API from Yahoo which offers real-time data, but I'd be curious if anyone hosts a service for historical data - i.e., what was the "severity" (one of the attributes the Yahoo API returns) for a given location at a given

Refresh Token for Google Api Php Client

荒凉一梦 提交于 2019-11-29 09:27:28
问题 I am using the Google API Client to access Google Analytics. I want to access the data in offline mode, so I need a refresh token. How do I get a refresh_token? 回答1: try using the following code: <?php require_once 'apiClient.php'; const REDIRECT_URL = 'INSERT YOUR REDIRECT URL HERE'; const CLIENT_ID = 'INSERT YOUR CLIENT ID HERE'; const CLIENT_SECRET = 'INSERT YOUR CLIENT SECRET'; const ANALYTICS_SCOPE = 'https://www.googleapis.com/auth/analytics.readonly'; // Build a new client object to

Google Analytics API - retrieve Custom Segment Id by its name

大兔子大兔子 提交于 2019-11-29 08:13:55
Using Google Analytics API to retrieve 20+ Profiles' data so i can combine all of them into one set of data for analysis. (separate profiles are for different domains that all have identical content) I am using a Custom Segment on each Profile to remove referral spam. I have given the Custom Segments the same name eg 'referrer spam'. So I want to use these Custom Segments when retrieving records with the API. However have run into a challenge. I thought I could loop through the segments and get each Profile's Id by the Custom Segment name eg 'referrer spam'. The first thing I did was loop

Google Analytics API oauth exception “invalid_grant” with Service Account. Same code on two servers. Only one works

孤街浪徒 提交于 2019-11-29 04:08:34
I'm querying the Analytics API via a Service Account . I have written the code on the dev server and it works without issues. When running the same code on the production server, it throws this: Google_AuthException: Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }' I've tried creating another Service account, and the behavior is the same. The oAuth IETF draft ( http://tools.ietf.org/html/draft-ietf-oauth-v2-31 ) says this about the error: invalid_grant The provided authorization grant (e.g. authorization code, resource owner credentials) or refresh token is invalid,

Using Google Analytics to show subset of data for customers of web application using embed api

大憨熊 提交于 2019-11-28 23:33:55
I'm developing an application where each 'business' has it's own page (or rather many pages): For example example. com/business/abc/ So, for the logged in business owners in the system I would like give a feature 'View page analytics'. It would display how many visits (and maybe a couple of other things) that particular page has had. Is there a way of doing this using the Google Analytics API with my constraints: I don't want customers to provide their own UA code I don't want them to require to have GA account Customers don't need to have Google email account I don't want to build entire