This guide describes how an application authorizes requests to the Management API.
MicroStrategy Desktop delivers a complete set of analytics capabilities that goes above and beyond other data discovery tools. And it’s free forever. Access to powerful data discovery with 100+ connectors and built-in data preparation with MicroStrategy Desktop. Official Google Analytics Help Center where you can find tips and tutorials on using Google Analytics and other answers to frequently asked questions. How strong is your WiFi signal? You can use the NETGEAR WiFi Analytics app to get advanced analytics that help you optimize your existing or newly extended WiFi network. Check your network status, WiFi signal strength, identify crowded WiFi channels, find clear channels with less interference and much more with the WiFi Analytics app from NETGEAR. Bview is the most full featured Google Analytics app for Windows Phone and Windows 8.1 (Universal App). Access all of your Google Analytics web and app reporting profiles from your PC, phone and tablet. The app has a look and feel that’s optimized for PCs, phones and tablets, so you can easily get your Analytics data anytime, anywhere. You can connect to Google Analytics data using the Google Analytics connector. To connect, follow these steps: In Power BI Desktop, select Get Data from the Home ribbon tab. In the Get Data window, select Online Services from the categories in the left pane. Select Google Analytics from the selections in the right pane.
Authorizing Requests
Before users can view their account information on the Google Analytics web site, they must first log in to their Google Accounts. Similarly, when users first access your application, they need to authorize your application to access their data.
Every request your application sends to the Analytics API must include an authorization token. The token also identifies your application to Google.
About authorization protocols
Your application must use OAuth 2.0 to authorize requests. No other authorization protocols are supported. If your application uses Google Sign-In, some aspects of authorization are handled for you.
Authorizing requests with OAuth 2.0
All requests to the Analytics API must be authorized by an authenticated user.
The details of the authorization process, or 'flow,' for OAuth 2.0 vary somewhat depending on what kind of application you're writing. The following general process applies to all application types:
Some flows include additional steps, such as using refresh tokens to acquire new access tokens. For detailed information about flows for various types of applications, see Google's OAuth 2.0 documentation.
Here's the OAuth 2.0 scope information for the Analytics API:
To request access using OAuth 2.0, your application needs the scope information, as well asinformation that Google supplies when you register your application (such as the client ID and theclient secret).
Tip: The Google APIs client libraries can handle some of the authorization process for you. They are available for a variety of programming languages; check the page with libraries and samples for more details.
Common OAuth 2.0 Flows
The following lists common use cases for specific OAuth 2.0 flows:
Web Server
This flow is good for automated, offline, or scheduled access of a user's Google Analytics data.
Example:
Client-side
This flow is ideal for applications when users interact directly with the application to access their Google Analytics data within a browser. It eliminates the need for server-side capabilities, but it makes automated, offline, or scheduled reporting impractical.
Example:
Installed Applications
This flow is for applications that are distributed as a package and installed by the user. This flow requires that the application or user have access to a browser to complete the authentication flow.
Examples:
Mac Desktop App Development
Service Accounts
Service accounts are useful for automated, offline, or scheduled access to Google Analytics data for your own account. For example, to build a live dashboard of your own Google Analytics data and share it with other users.
To get started using Analytics API, you need to firstusethe setup tool, which guides you through creating a project in theGoogle API Console, enabling the API, and creating credentials.
To set up a new service account, do the following:
Your new public/private key pair is generated and downloaded to your machine;it serves as the only copy of this key. You are responsible for storing itsecurely.
Note: You need to add the service account email address as an authorized user of the view (profile) you want to access.
Troubleshooting
Your authorization fails in these situations:
OAuth 2.0 playground
This tool allows you to go through the entire authorization flow through a web interface. The tool also displays all the HTTP request headers required for making an authorized query. If you can't get authorization to work in your own application, you should try to get it working through the OAuth 2.0 playground. Then you can compare the HTTP headers and request from the playground to what your application is sending to Google Analytics. This check is a simple way to ensure you format your requests properly.
Desktop Analytics BlogInvalid grant
When you try to use a refresh token, the following returns you an
invalid_grant error:
Google Analytics Desktop App Mac Os
Applications can request multiple refresh tokens to access a single Google Analytics account.
For example, if a user wants to install an application on multiple machines and access the same Google Analytics account, then a separate token would be required for each machine. When the number of refresh tokens exceeds the limit, older tokens become invalid. If the application attempts to use an invalidated refresh token, an
invalid_grant error response is returned.
The limit for each unique pair of OAuth 2.0 client and Google Analytics account is 25 refresh tokens. If the application continues to request refresh tokens for the same Client/Account pair, once the 26th token is issued, the 1st refresh token that was previously issued will become invalid. The 27th requested refresh token would invalidate the 2nd previously issued token and so on.
Note:
Google Analytics Desktop App Mac DesktopThe limit of 25 refresh tokens is subject to change.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |