I have account that has 100 accounts, I've added a Google Service account (I can't use anything else because of 3rd party app limitation) and now I need to allow it to access all of these accounts. Seems there's no way at Google Analytics UI to do that and I will have to manually edit 100 accounts.
Is there any better way to do it? Maybe something like AdWords Editor just for Analytics?
If you have a Google User Account that has access to all the Google Analytics Accounts (which is how I interpret your first sentence) you can bulk edit them via the Google Analytics Management API, and that includes adding users that might or might not be service accounts. A reasonable easy way would be to use a Google Spreadsheet and some Google Apps Script. The script will run as the user that is currently logged in to Google and will be able to access all Analytics account that user has access to.
However you need to have necessary permissions to edit the GA accounts, so if you do not already have an authorized account you will (unsurprisingly) not be able to add one
Related
Okay, some heads-ups as I feel I'm an idiot and missing some simple stuff. As far as I understand Google Analytics works with a 3 tiers system: account -> property -> view. and I should be able to manage these 3 levels via the google analytics management api.
For some context as to why I encounter this issue. I am making a CMS in which I want to register a new google analytics account per user, and a property per website this user has. (implementation and usage of views out of scope for now, I will implement those on a later date). To achieve all of this I started following Google's documentation on the Google Analytics Management API (according to Google this is what manages accounts, properties and views). Therefor I have made a service-user-account which should have enough permissions to manage GA-accounts.
However I can't seem to be able to create a new account via the API. Am I missing something obvious? Is it not possible at all this way? If so, how then? Because my goal is to have GA on every website, without the user having to config anything.
You can't do it. The management API only allows for the list operation on accounts: https://developers.google.com/analytics/devguides/config/mgmt/v3/account-management#account_summaries
The only solution would be to use the Provisioning API. It can be used to create new Google Analytics accounts and enable Google Analytics for your customers at scale: https://developers.google.com/analytics/devguides/config/provisioning/v3/
Anyway, the Provisioning API is currently available by invitation only.
How can i use gapi.analytics.auth.authorize without button..
I need it for customers, to track visits on their subdomain, and I have my analytics code on page, so they can't use button to authorize, need without it, automatically.
Any example?
Your question isn't very clear it is hard to understand what you mean by Button.
I think you mean that you would like to select data from YOUR Google Analytics account and display it on YOUR website.
To do this you will need to use a service account as apposed to Oauth2 (Oauth2 would popup with a new window requesting access). When you create the service account in the Google developer console take the service account email address. Give it access at the ACCOUNT level in the Google analytics admin section. It must be the account level this will then give the service account access to read your Google analytics data.
Quota: I am not sure what you are extending to do here but remember you can only make 10000 requests per day against your Google Analytics profile. After that you are cut off there is no way to extend this number. So I advice you to save the data in the database someplace you shouldn't request the same data more then once.
Example:
I suggest that you look for an example in what ever programing language you are intending to use. Again your question doesn't state anything about what language you will be using. Hello analytics API might be a good place to start but it depends upon the language the PHP one is way out of date I wouldn't bother with it. Also you cant use a service account with JavaScript so that one is out to.
Update figured out button
Embded api I think I have finally figured out what you mean by button. gapi.analytics.auth.authorize is used in the Google analytics embedded api. Which is JavaScript which it is not possible to use with a Service account. So the final answer to your question is
Answer: You cant remove the button from the Google Analytics Embded api the only way to login with JavaScript is to use Oauth2.
Advice: switch to PHP and use a service account to request data yourself. Or give each of your customers access to your Google analytics so they can login themselves.
I have taken over a .net site.
when I view the source I see it has the Google analytic code.
ga('create', 'UA-51570230-1'...
But to access this you need to login to your gmail account, but am not sure what it is.
is there any other way to get the Google analytic information?
The only way to get access to the Google Analytics account is to have the owner of the account 'UA-51570230-1' give you access. There is also no way to find out who or what email address owns the account 'UA-51570230-1'.
Unfortunately the only thing you can do really is to either track down the owner of the account or start over creating a new account and changing the code on the site.
Suppose that a user has a Google account (say a Gmail account), but he does Not have a Google Analytics account.
Can we have a 3rd party application use the Management API (when the user is willing to authenticate it via OAuth2 using his Google account) to reach the stage of creating Tracking Code ?
I am asking this because, in https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/ , only 'list' is the method that is available for Accounts.
It doesn't appear that you can create a fresh GA account from the Management API. You can, however, list, create, edit, and delete users from an existing GA account:
User Permissions in the Management API allows you to list, create, edit, and delete users from your Google Analytics account. This is useful if you want to automate adding new users to Google Analytics, or removing a set of users.
User Permissions - Developer Guide
Add a Single User
We have certain amount of clients and each of us will have their pages on our website. We have to show them the analytics for their particular page. For this, we have the data on Google Analytics according to pages.
On the client admin page, they should be able to view the analytics for their page. This has to be coming from Google Analytics.
I have tried using the Core Reporting Api, but that needs an authentication and one should have access to Google Analytics profile, which is not possible for clients.
So now, Is there a way, where the client can see the dashboard with data being pulled form Google Analytics without any authentication?
No, authentication is required to pull data directly from Google. You could use one 'global' Google account and keep that account authenticated through code so that your users can access that data.
Only other option I've seen is to automate the export of the CSV data (via email) and have a routine that pulls off the CSV data and imports it into a system for public/private use - such as in your example.
Hope this helps!