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

Question:

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!


Answer:

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.


Related:


Google Identity Toolkit returns INVALID_CREDENTIALS


php,google-api,google-api-php-client,google-identity-toolkit
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":...

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


javascript,oauth,google-drive-sdk,google-spreadsheet,google-oauth
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...

unable to add callback: cannot be converted to ConnectionCallbacks


android,google-api
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....

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


java,google-oauth,gdata,google-contacts
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...

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


java,android,oauth-2.0,google-oauth
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;...

Gmail API: Insufficient Permission


php,email,google-api,gmail,gmail-api
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...

Gmail API: How to get access token?


php,google-api,google-oauth,google-api-php-client,gmail-api
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...

Making an iOS authorised Google API call


ios,google-api,access-token
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...

Annotation chart google function after rangechange


javascript,google-api,google-visualization
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 google.visualization.events.addListener(chart, 'rangechange', feed_with_chartMap); in the documentation but the function is not only called when...

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


java,android,google-api,google-api-java-client,google-login
I want to access the google account to login my app,and I get: Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: 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: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion '22.0.1' defaultConfig { applicationId "nthu.nf.project.moocs" minSdkVersion 15 targetSdkVersion 21...

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


php,google-calendar,google-oauth,google-api-php-client,service-accounts
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...

How to create a script to query Google Browserlocation


json,google-api
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...

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


javascript,google-api,text-to-speech,http-status-code-403,google-translate
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 http://translate.google.com/translate_tts as the base URL and tl for target language and q...

Cannot refresh token from google api OAuth2


php,google-oauth
Here is my php script RefreshToken.php <?php $url = 'https://accounts.google.com/o/oauth2/token'; $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 =...

access drive with access token


php,google-drive-sdk,google-spreadsheet,google-oauth
struggling to understand the oauth2 token and refresh token processes ive got this code $url = 'https://www.googleapis.com/oauth2/v3/token'; $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...

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


android,google-api
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...

Google Developer API V3 for video upload in YouTube C#.net


c#,youtube,google-api,youtube-api,google-api-dotnet-client
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...

Google SignIn State


login,oauth-2.0,google-oauth
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...

Oauth2 using Python 3.4 and Django 1.7


python,django,python-3.x,google-oauth
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='https://www.googleapis.com/auth/content', redirect_uri='https://127.0.0.1:8000/oauth2/oauth2callback')...

Getting user credentials using Google+ API


android,google-app-engine,google-api,google-api-java-client
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 https://www.googleapis.com/plus/v1/people/me...

Access spreadsheet via Google API invalid_grant


java,google-api,google-spreadsheet,gmail-api
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 =...

Google Drive API 500 null errors when copying


google-api,google-drive-sdk,google-api-php-client,google-api-client
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: developers.google.com/drive/v2/reference/files/copy Google_Exception: Error calling POST https://www.googleapis.com/drive/v2/files/#fileid#/copy: (500) { "error": { "code": 500, "message": null } } This issue seem...

Gmail API: example of a request to the API


php,google-api,google-oauth,google-api-php-client,gmail-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?


android,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?

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


c#,c#-4.0,google-api,google-drive-sdk
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...

Google Scripts + Google API PHP


php,google-apps-script,google-api,google-apps,google-api-php-client
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...

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


c#,google-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...

Google authentification with “devise” fail


ruby-on-rails,devise,google-oauth,omniauth
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 <%= current_user.name %>. Not you? <%= link_to "Sign out", destroy_user_session_path,:method => :delete %> <% else %>...

Are there google apis to update a google sheet


google-api,google-spreadsheet
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 ? https://developers.google.com/google-apps/calendar/v3/reference/ Thanks...

How to use nextPageToken in Google Apps Reseller API?


google-api,google-admin-sdk,google-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 Calendar: How to check guest is not busy and available to book through google calendar


google-apps-script,google-api,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 ?...

Hide referrer header in API request


javascript,api,google-api,cross-domain,referrer
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, http://weston.ruter.net/2009/12/12/google-tts/ and Request to Google Text-To-Speech API...

Freebase Search API - Get All Results


java,google-api,resultset,freebase
Is it possible now to get all results from Freebase Search API? Today I was trying 2 approaches in Java: 1) www.googleapis.com/freebase/v1/search?filter=..." Using "cursor"(integer) and "limit" options. 2) www.freebase.com/ajax/156b.lib.www.tags.svn.freebase-site.googlecode.dev/cuecard/mqlread.ajax?&query= Try to simulate 'Query Editor' (https://www.freebase.com/query) Using "cursor" from the previous results set (String). But in both of these approaches I...

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


google-api,google-cloud-platform,google-cloud-logging
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":...

Prompt user to enter password - Google OpenID Connect


google-oauth,google-openid,openid-connect,google-oauth2
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 can I make a copy of a file in Google Drive via Python?


python,google-drive-sdk,google-oauth
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...

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


python,google-oauth,gdata,google-contacts
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...

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


c#,.net,google-api,youtube-api,google-api-dotnet-client
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...

Google Cloud Datastore PropertyFilter Error


php,google-app-engine,google-api,google-cloud-datastore,google-php-sdk
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,...

How to access gmail API?


javascript,google-api,gmail-api,vertx.io
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": "jc6.apps.googleusercontent.com", "type": "service_account" } first generate token...

What does “offline” access in OAuth mean?


oauth,google-oauth,google-oauth2
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...

Why this google font is not working?


html,css,google-api
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='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700,300,300italic' rel='stylesheet' type='text/css'> Here's the entire : <head> <meta charset="UTF-8" /> <meta...

Providing login_hint option for Google Oauth2 redirect


oauth,google-api,google-oauth
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...

Value cannot be null. Parameter name: baseUri


c#,google-api,google-bigquery,google-api-dotnet-client,service-accounts
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...

Advanced gmail search for received emails only


email,google-api,gmail,gmail-api,incoming-mail
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 Weather API


api,google-api,weather,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?

google Oauth login in https server


javascript,meteor,google-oauth
I have an meteor web server on Https server say https://popasdesasdasd.com. I added this url to the Javascript Origin uri and https://popasdesasdasd.com/_oauth/google?close in redirect uri. On request, it says mismatch uri and asked to put http://popasdesasdasd.com/_oauth/google?close in redirect uri. Adding that gives me an error of Uncaught SecurityError: Blocked a...