google-api,google-oauth,google-analytics-api , Google Analytics Embed API: Display specific account data, not authenticated users

Google Analytics Embed API: Display specific account data, not authenticated users


Tag: google-api,google-oauth,google-analytics-api

I have this example - Embed API Third Party Visualizations - working locally and on a test server, but I'm unsure of what I need to do to ONLY display our organization's Google Analytics data instead of the user's personal GA account.

I created the project and clientID within our org's Google Account, but I'm obviously not understanding something big here.

I'm completely new to both GA's API and oAuth in general, so while I'm sure this has been answered multiple times, I wasn't completely sure which direction to look in. If someone can give a helpful nudge in the right direction I'll happily be on my way.

Thanks everyone!


Embeded API uses Oauth2 to authenticate. Oauth2 requires that a user give you access to their Google Analytics data.

You want to show your person Google Analytics data to other users. Normally I would say you should use a Service account, a service account gives the application direct access to a specific account it has to be set up like you would add a user to Google Analyitcs. The problem is the Embeded API uses JavaScript, for security reasons its probably not a good idea to use a service account with JavaScript. I also think it may be against Googles terms of service to use a service account with JavaScript. That being said I have never found anyone who has gotten a service account to work with JavaScript probably for the reasons I just stated.

Drop the embedded API and switch to a server sided language of some kind and code it yourself. What you want to do cant be done with the embedded API.


Are there google apis to update a google sheet

I want to listen to calendar events and update cells in the google sheet. I have found apis for calendar but are there any apis available to update cells in google sheet ? Thanks...

How to authenticate a java application for the Google Contacts API?

I've had a java application running for a few years that synced some contacts from some database into the gmail account of a customer. This stopped working a few days ago, presumably because Google stopped supporting the simple username/password authentication. First question: Am I correct in assuming that the only...

Google Weather API

I want to make an app using Google weather API. But I don't have any knowledge about it. How do I use API? Could you explain step by step how I start project?

Freebase Search API - Get All Results

Is it possible now to get all results from Freebase Search API? Today I was trying 2 approaches in Java: 1)" Using "cursor"(integer) and "limit" options. 2) Try to simulate 'Query Editor' ( Using "cursor" from the previous results set (String). But in both of these approaches I...

Value cannot be null. Parameter name: baseUri

I am using Google BigQuery API with Service Account Authorization in C# console application. When i am trying to load CSV job, it throws "Value cannot be null. Parameter name: baseUri" Exception. It specific on only single table, when i am changing the table name it all gets work. Here...

Unable to implement Google API 'Search using a specific app'

I am trying to implement the 'Search using a specific app' functionality as per the android documentation. But I am unable to get it working. This is my query 'Ok google, search for xyz on helloapp' Following is my implementation. I have added meta data which is not required, but...

Cannot refresh token from google api OAuth2

Here is my php script RefreshToken.php <?php $url = ''; $post_data = array( 'code' => 'xxxxxxxx', 'client_id' => 'xxxxxxxxxxx', 'client_secret' => 'xxxxxxxxxxxxx', 'redirect_uri' => 'http://localhost/googleapi/AuthenticationCode.php', 'grant_type' => 'authorization_code', ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result =...

Google Logging API - What service name to use when writing entries from non-Google application?

I am trying to use Google Cloud Logging API to write log entries from a web application I'm developing (happens to be .net). To do this, I must use the logging.projects.logs.entries.write request. This request dictates that I provide a serviceName argument: { "entries": [ { "textPayload": "test", "metadata": { "serviceName":...

access drive with access token

struggling to understand the oauth2 token and refresh token processes ive got this code $url = ''; $data = array('client_id' => 'clientid', 'client_secret' => 'secret','refresh_token' => 'token','grant_type' => 'refresh_token'); $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded", 'method' => 'POST', 'approval_prompt'=>'force', 'access_type'=>'offline', 'content' => http_build_query($data), ), ); $context...

Why this google font is not working?

Have this line on my label and is working properly on a Debian server under Apache, but when I uploaded it to my production server (Debian with Apache too) i cannot get the Open Sans Condensed font. <link href=',300,300italic' rel='stylesheet' type='text/css'> Here's the entire : <head> <meta charset="UTF-8" /> <meta...

Google Drive API 500 null errors when copying

I'm getting this error message (100% of the time) when copying a shared file, using the latest version of php library. And I'm getting the same response via the API explorer: Google_Exception: Error calling POST (500) { "error": { "code": 500, "message": null } } This issue seem...

Providing login_hint option for Google Oauth2 redirect

I'm passing in login_hint=1 option as part of Oauth2 request query string but this doesn't appear when I receive a callback from Google Oauth2 after accepting it. I'm only getting: google/oauth2callback?code=4/vadsdaalijfqwo8fdjqojcxadassddsa# I was expecting 1 (which is user id) to come back as part of callback. How do I make...

How can I make a copy of a file in Google Drive via Python?

I wrote a short function in Google Apps script that can make a copy of a specific file that is stored on Google Drive. The purpose of it is that this file is a template and every time I want to create a new document for work I make a...

google Oauth login in https server

I have an meteor web server on Https server say I added this url to the Javascript Origin uri and in redirect uri. On request, it says mismatch uri and asked to put in redirect uri. Adding that gives me an error of Uncaught SecurityError: Blocked a...

Gmail API: How to get access token?

I am testing the Gmail API. So far I have done the following: I have created the project in the Google Developers Console I have enabled the Gmail API. I have created a new Client ID and the client secret. In my PHP script I have installed the PHP Client...

How can I insert data (event) into Google Calendar with PHP?

I am trying to insert events into Google Calendar, but I get errors everytime. I've been searching for hours to get answer, but I found nothing for my problem. I tested a lot of examples, without success. I'm new in Google Calendar, and I can't really understand the google api...

Google Cloud Datastore PropertyFilter Error

I'm using the google apis php sdk and trying to access some data from my google cloud datastore. I'm authenticating no problem at this point, but am getting an error during my query. I pretty much look through the code in the sdk to implement it, since documentation is null,...

Google Calendar: How to check guest is not busy and available to book through google calendar

I am exploring to write google calendar api integration through google scripts or apis. Is there a way I can check a guest is available before I book an event ?...

Can I associate a user's account with an action to the drive API?

We're looking to make a little webapp to manage our week-long nerf war (humans vs zombies to be precise), and we're thinking about how easy it would be to have Google Sheets be our only backend, and our frontend be entirely javascript/html/css. Let's say there's two actions that can be...

Hide referrer header in API request

I need to make requests to Google Translate Text-To-Speech API. I have an enabled key but keep getting blocked by No Access-Control-Allow-Origin. I've posted more about it here: Google Translate API - No Access Control Origin with Text to Speech The following sources, and Request to Google Text-To-Speech API...

I want to upload video on youtube using client side login. without open web page permission

When I upload video to YouTube using client side login. The first time redirect to UI for permissions. I want upload without redirect to web page. I need to execute this code on server. Here is my code. private async Task<string> Run(string title, string description, string filepath) { var videoID...

Access spreadsheet via Google API invalid_grant

I have created a google form, and keeping the form result in an excell sheet named yht_istekler. I am using following code snippet. taken from Create Spreadsheet using Google Spreadsheet API in Google drive in Java Though I am getting following error, what am I doing wrong? List<TrenSeferScheduleEvent> trenSeferScheduleEventList =...

How to use nextPageToken in Google Apps Reseller API?

I am writing a simple Java application that fetches all customer subscriptions from Google Apps Reseller using the Reseller API. However I am stuck at paging through the results as the max size is 100 per page and I cannot figure out the next page token. Here is the code...

Google Translate API text-to-speech: http requests forbidden

I am making a language learning web app that when you hover over the word, it pronounces it for you. I'd like to access the native speaker translations from Google Translate API. I've found this resource which gives as the base URL and tl for target language and q...

Google Developer API V3 for video upload in YouTube

I have been using google's reputed API V2 for uploading the videos on YouTube from my web application as there has been up gradation in API to V3 , I am unable to upload the same through the same code. I have tried with the new application for uploading the...

Making an iOS authorised Google API call

I have integrated Google Sign-in into my iOS app and retrieved the access tokens after signing in. I am now wanting to make authorised API calls to Google, but am unsure how to do this to include the token. Can someone please share some code that I can use to...

Limited number of rows returned from Google spreadsheet and the Sheets Api

I have a spreadsheet on Google Drive with 571 rows that I read from an other application. I call it using the Google.GData.Spreadsheets 2.2.0 lib and the following piece of simplified code. static void Main(string[] args) { var certificate = new X509Certificate2("Key.p12", "blahblah", X509KeyStorageFlags.Exportable); const string user = "[email protected]"; var...

Gmail API: Insufficient Permission

THE SITUATION: I am testing the Gmail API for my app. I have tested some requests and they are working fine. For example get messages, get user history, get draft list etc.. Basically all the read only requests are working fine. I have instead some issues related with permission with...

unable to add callback: cannot be converted to ConnectionCallbacks

I am trying to add call back to my googleApiClient with addConnectionCallbacks mPlusClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN).build(); but i am getting this error: Error:(85, 81) error: incompatible types: PlusBaseActivity cannot be converted to ConnectionCallbacks I am gotten this code from an online tutorial but it doesnt seems to work, please help....

What is the correct mechanism to authenticate to Google in a standalone Python script?

I've got some code that I'm using to extract email address from Gmail contacts into text file. It's a simple Python script that runs in a cron job, and is based on the Python gdata library (currently v2.0.18). As of earlier this month, this no longer works due to Google...

Getting user credentials using Google+ API

I am trying to include Google sign in in my android application using Google+ Api. I am able to take account details from the user but once signed in I am getting null when requesting for username using call: Plus.PeopleApi.getCurrentPerson(mGoogleApiClient).getDisplayName() And Logcat shows: BasicNetwork.performRequest: Unexpected response code 403 for

Google Identity Toolkit returns INVALID_CREDENTIALS

I'm currently trying to implement a forgot password feature using the Google Identity Toolkit. The PHP backend is trying to get the oob code because client (iOS) does not have sufficient privileges. Whenever I run the script I get an error of INVALID_CREDENTIALS, more specifically: oob Code: string(249) "{ "error":...

Google Scripts + Google API PHP

I am trying to call one of my Google Scripts from my google-api-php-client and I can't find how to do this. I deployed my app as a web app, and I got the web app url which I can call with curl, but I need to call it as my...

Advanced gmail search for received emails only

I'm using the Google gmail API to get emails from peoples gmail account. I filter for emails containing the word "CompanyName" which have a pdf as an attachment. using the following search query: CompanyName filename:pdf. I now want to further specify this by only getting emails that were received, instead...

Google authentification with “devise” fail

I want to create a GOOGLE authentification in my app. So in set up "omniauth" and "devise" correctly (I think). In my layout folder in "_header.html.erb" view : <% if user_signed_in? %>Signed in as <%= %>. Not you? <%= link_to "Sign out", destroy_user_session_path,:method => :delete %> <% else %>...

finished with non-zero exit value 2 when I use google login api

I want to access the google account to login my app,and I get: Error:Execution failed for task ':app:dexDebug'. > org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 My build.grade: apply plugin: '' android { compileSdkVersion 22 buildToolsVersion '22.0.1' defaultConfig { applicationId "" minSdkVersion 15 targetSdkVersion 21...

Prompt user to enter password - Google OpenID Connect

We are trying to use Google's OpenID Connect for a business web app but are concerned that the user will leave the app open and an unauthorized user will sign-in because the user is still signed into Google so OpenID Connect just let's them right in. We've tried using max_auth_age=0...

How to create a script to query Google Browserlocation

I'm trying to figure out a way to get geolocation data from Google's Browser location API. I found JSON, CURL and Google's geolocation, and have it working as far as list of access points in range, but my limited cli-fu won't let me parse this into something I can send...

How to access gmail API?

I generate my JWT, if my token is correct why dont work ? in Google Developers Console i enabled gmail plus youtube and other API, in credentials generate and download json { "private_key_id": "22dcf", "private_key": "-----BEGIN PRIVATE KEY-----(remove)-----END PRIVATE KEY-----\n", "client_email": "[email protected]", "client_id": "", "type": "service_account" } first generate token...

What does “offline” access in OAuth mean?

What exactly does the word "offline" mean with regard to the offline access granted by an OAuth server? Does it mean that the resource server will return data about the user even when the user is logged out of the third-party application or when the user is logged out of...

Google SignIn State

I'm trying to build a Google signin button into my website. I'm trying to avoid using their built-in button. The code below works to sign in a user, but I can't figure out how to make my webpage remember that they're signed in when the user refreshes the page, or...

Google Drive API: I have to fetch only files in that folder without trashed files

I am trying to get a list of files in a folder on Google drive using the Google drive API. When I make my request I am getting a list of child elements in that folder including previous deleted files. How do I get only the files that are in...

Gmail API: example of a request to the API

I am trying access the Gmail API with my application. I should have done properly all the setup and I am testing a request to the API, in the specific the request to get the messages as read only. My code: public function gmail_get_messages() { $client = new Google_Client(); $client->setApplicationName("Gmail...

What is the difference between Android API and Google API?

I have gone through some of the links that difference between the Google API and android API.I have not got clear explanation.Anyone Can you help me please?

Annotation chart google function after rangechange

I'm using the annotation chart and the map from google api, I would like to know if there's anyway to trigger a function after the range change when the user's clic releases. I just find this, 'rangechange', feed_with_chartMap); in the documentation but the function is not only called when...

How to use token obtained using GoogleAuthUtil class to get user information?

I am building an Android app in which I want to authenticate user using their google account. I am using GoogleAuthUtil class to obtain token from google as shown below protected String fetchToken() throws IOException{ try { return GoogleAuthUtil.getToken(act, email, scope); } catch (GoogleAuthException e) { e.printStackTrace(); } return null;...

Oauth2 using Python 3.4 and Django 1.7

I'm trying to authorize my django application using oauth2 in order to interact with the google content for shopping API. However, I'm experiencing issues with oauth2 along the way. I have oauth2client and google-api-python-client installed. My view is as follows: CLIENT_SECRETS = os.path.join(os.path.dirname(__file__), 'client_secret.json') FLOW = flow_from_clientsecrets( CLIENT_SECRETS, scope='', redirect_uri='')...