google-analytics-api

Google Analytics API error 403: “User does not have permission to access profile”

六眼飞鱼酱① 提交于 2019-12-02 01:36:38
I've been trying to learn how to use the Google Analytics API to get site traffic data. I keep running into an error saying that the user does not have permission to access the profile. I added the email address from the service account to the users and tried making it both a user with access to all profiles and an administrator and neither worked. This is my code, which I got from here : string scope = AnalyticsService.Scopes.AnalyticsReadonly.GetStringValue(); string clientId = "xxxxxxxx@developer.gserviceaccount.com"; string keyFile = @"C:\Users\emorris\Downloads\xxxxxxxxxx-privatekey.p12";

Google OAuth: can't get refresh token with authorization code

笑着哭i 提交于 2019-12-02 00:37:36
I am using Google API Client for Google Analytics with OAuth 2.0 I read this to get the refresh token but it doesn't appears: https://developers.google.com/identity/protocols/OAuth2WebServer#offline I only get this instead: { "access_token": "ya29.twHFi4LsiF-AITwzCpupMmie-fljyTIzD9lG8y_OYUdEGKSDL7vD8LPKIqdzRwvoQAWd", "token_type": "Bearer", "expires_in": 3599, "id_token": "very long string" } Here is the code: Javascript (to get the Authorization Code): that works gapi.analytics.ready(function() { gapi.analytics.auth.authorize({ container: 'embed-api-auth-container', clientid: '257497260674

Google API - forces to Grant Permission Every time

丶灬走出姿态 提交于 2019-12-01 22:43:10
I am using Google API PHP Client. And every time i try to login I am forced to grant permissions to the apps. Below is my code. I am basically accessing Google API for Analytics require_once 'lib/apiClient.php'; require_once 'lib/contrib/apiAnalyticsService.php'; session_start(); $client = new apiClient(); $client->setApplicationName("Google Analytics"); $client->setClientId('7xxxx'); $client->setClientSecret('xxxx'); $client->setRedirectUri('xxxx'); $client->setDeveloperKey('xxxx'); $analytics = new apiAnalyticsService($client); if (isset($_GET['logout'])) { unset($_SESSION['token']); } if

Google API - forces to Grant Permission Every time

你离开我真会死。 提交于 2019-12-01 22:36:58
问题 I am using Google API PHP Client. And every time i try to login I am forced to grant permissions to the apps. Below is my code. I am basically accessing Google API for Analytics require_once 'lib/apiClient.php'; require_once 'lib/contrib/apiAnalyticsService.php'; session_start(); $client = new apiClient(); $client->setApplicationName("Google Analytics"); $client->setClientId('7xxxx'); $client->setClientSecret('xxxx'); $client->setRedirectUri('xxxx'); $client->setDeveloperKey('xxxx');

gapi account data url goes to 404

£可爱£侵袭症+ 提交于 2019-12-01 20:37:25
问题 Does anyone know the new account data url used by the GAPI 1.3.1 class? The current one is https://www.google.com/analytics/feeds/accounts/default but it goes to a 404 Regards, 回答1: Go to : https: // code.google.com /apis/console/ Login and create a new project Turn on Analytics API Click on Analytics API link and then in the left menu choose API Access Note down the API Key (Key for browser apps ) Then inside your code, where you had: https: // www.google.com/ analytics/feeds/accounts

gapi account data url goes to 404

岁酱吖の 提交于 2019-12-01 18:32:01
Does anyone know the new account data url used by the GAPI 1.3.1 class? The current one is https://www.google.com/analytics/feeds/accounts/default but it goes to a 404 Regards, Go to : https: // code.google.com /apis/console/ Login and create a new project Turn on Analytics API Click on Analytics API link and then in the left menu choose API Access Note down the API Key (Key for browser apps ) Then inside your code, where you had: https: // www.google.com/ analytics/feeds/accounts/default will be replaced with: https:// www. googleapis.com/ analytics /v2.4/management/accounts There is one more

How do I delete user analytics data from Firebase using userDeletionRequests:upsert?

微笑、不失礼 提交于 2019-12-01 15:22:00
Problem Description My Android app collects data via Google Analytics for Firebase. For privacy reasons, users must be able to wipe their data off the Firebase servers, should they choose to do so. The app requests a deletion by forwarding its Firebase APP_INSTANCE_ID to my own server. This server has been prepared in advance with credentials, from my personal Google account (via oauth2), for managing the Firebase project. The server authenticates with www.googleapis.com , and, using the supplied APP_INSTANCE_ID , invokes the upsert. As noted by the documentation , the generic Google Analytics

Limit on Google Analytics asynchronous event push?

大城市里の小女人 提交于 2019-12-01 12:15:29
I have a piece of code that records events in Google Analytics based on an array of data when my application initializes. It goes something like function recordInitialData(dataArray) { for(var i = dataArray.length; i >= 0; i--) { _gaq.push(["_trackEvent", category1, action1, label1, dataArray[i].value1],["_trackEvent", category2, action2, label2, dataArray[i].value2]); } } The problem is, _gaq.push gets called only 10 times (that is to say, there are only 10 1x1 gifs loaded and represent only the first 10 events that were given to _gaq.push ), no matter how many calls I actually make (because

How to POST a multipart/form-data using Power Query's Web.Contents

浪子不回头ぞ 提交于 2019-12-01 10:54:09
In Power Query, I can download data from Web using the Web.Contents function, but there's an api that required the request to contains multipart/form data in the following format "__rdxml"=<*Some data*> So how do you do this using the Web.Contents function? I tried, doing ... PostContent = "__rdxml=<*Some data*>", Source Web.Contents(url,Content=Text.ToBinary(PostContent)) ... But server response with 400 Bad Request . I checked the raw request with Fiddler, it seem like the request is not sending with content-type=multipart/form-data header. I tried manually adding the content-type header

Limit on Google Analytics asynchronous event push?

匆匆过客 提交于 2019-12-01 10:17:16
问题 I have a piece of code that records events in Google Analytics based on an array of data when my application initializes. It goes something like function recordInitialData(dataArray) { for(var i = dataArray.length; i >= 0; i--) { _gaq.push(["_trackEvent", category1, action1, label1, dataArray[i].value1],["_trackEvent", category2, action2, label2, dataArray[i].value2]); } } The problem is, _gaq.push gets called only 10 times (that is to say, there are only 10 1x1 gifs loaded and represent only