EDIT
I'm following this tutorial to Add Analytics to myAndroid App
but when I reach the step where I should get a a configuration file when I go to the page where I should download my JSON file it just gives me the spinning downloading circle for a long long time and I can't get the file.
I'm logged in with my Google account.
Is there any other way to get the file?
It turned out that it's a common issue
check out this issue in analytics-issues group here.
To solve this problem I followed those steps
Go here and sign in with your account.
Create a project.
Give your project a name.
In Use Google APIs click Enable and manage APIs.
From Advertising APIs click Analytics API.
Click Enable API.
if it shows this warning Click "Go to Credentials" if not skip to Finally
This API is enabled, but you can't use it in your project until you
create credentials. Click "Go to Credentials" to do this now
(strongly recommended).
From the list Where will you be calling the API from? select the platform. In my case was Android.
Click find out what Credentials I need and see it
Click Cancel.
Then you will be prompted to create Credentials you need. Create them.
Finally:
Now go to this Link which in the tutorial to get your JSON file
Pick a platform.
Create or choose an app.
Choose service and configure.
Choose or create an account from the dropdown list
Choose Analytics property
Click Enable Analytics services .
If you don't see the big blue button Generate configuration file scroll down to see it.
Hit it.
Hit Download google-services.json and voila
You got it.
Related
From my Google Play console I linked a project. Then I created a service account. Still, when refreshing the console, it still says "There are no service accounts associated with your project."
Waited over 24 hours already. The purpose of all that is receipts validation.
Picture 1: a linked project:
Picture 2: service-account created:
I had the same problem, I fixed it this way:
When you create a service account in step 2, you need to select a role to grant this service account some permissions, although it shows the step is optional, but for some cases, it's not. If you skip this step, the newly created service account will not show up at the Google Play Console API access page, and you will get this error message, The current user has insufficient permissions to perform the requested operation when you run your code.
You much enable "Google Play Android Developer API" (one of Google Api & services) for your application via a credential!
Google supplies many API for developers can call them from their app. A credential same as a permit (3 types of credentials : API key (such as youtube), OAuth, Service Account)
If you never enable one API, it never shown on API Access page!
In my case:
Even if you have created a service account,
When you have already deleted the service account with the same name,
It appears to have been deleted from the IAM tab of Google Cloud Platform.
So it is assumed that it is not visible in the play console.
TODO:
Create a service account with a different name (I gave the owner permission in step2 when creating, Like Q Locker's answer.).
After creation, it was immediately exposed in the play console.
I faced the same issue because I selected a wrong project instead of the project for which the service account to be created. Please double check the project name in the drop-down at top of the page (after going to the link of Google Cloud Platform). By default the right project to be selected automatically. But if no project is selected beforehand and you are asked to select a project, then select the right project carefully. Otherwise the service account won't show up after completing the whole process.
Another thing to mention, although the project is supposed to be selected automatically, initially it didn't happen and I was given the available projects to select from. The project may appear in the recent projects, otherwise click the SELECT PROJECT link and find yourself.
Moreover when I additionally logged out and removed all the other Google accounts from the browser except the account which is used in Google Play Console. That time I was redirected to service account creation page with the correct project selected beforehand.
Make sure the project name on screen 1 and screen 2 are the same. In my case project name were different.
Screen 1: Main API Access page on Google Console
Screen 2: Google Cloud Platform page
I am getting exception as below:
Well, I've used or say copied same code as this shown in google doc https://developers.google.com/google-apps/calendar/quickstart/android .And I know it is the same error which is already mentioned in troubleshooting part of this doc but as mentioned in its solution, I had checked my SHA1 fingerprint and also package name and all the stuffs but still getting same error. And also I tried to google and followed each and every link the google suggested but nothing works for me so my last option was STACKOVERFLOW and so I am here. Please help if any one can. Thanks in advance.
Also I forgot to mention, it says "Unregistered Android application" it means that the OAuth2 client ID I created is not found by the app but I don't know how can I make it find my OAuth2 client ID and solve my problem.
Please make sure that:-
You enabled calendar API in google console for that project you are using, as the link provide in your response.
Also match your package name in AndroidManifest is similar to the package you mentioned in google dev console with SHA.
Try to create an Oauth client id under corresponding project in google console. Follow the steps in this link.
To create an OAuth 2.0 client ID in the console:
Go to the Cloud Platform Console.
From the projects list, select a project or create a new one.
If the API Manager page isn't already open, open the console menu and select API Manager.
On the left, click Credentials.
Click New Credentials, then select OAuth client ID.
Note: If you're unsure whether OAuth 2.0 is appropriate for your project, select Help me choose and follow the instructions to pick
the right credentials.
Select the appropriate application type for your project and enter any additional information required. Application types are described
in more detail in the following sections.
If this is your first time creating a client ID, you can also configure your consent screen by clicking Consent Screen. (The
following
procedure
explains how to set up the Consent screen.) You won't be prompted to
configure the consent screen after you do it the first time.
Click Create client ID.
Based also from this related post, you have to give permission from your calendar configuration (Calendar configuration -> Share this calendar) to the email account specified into Google Api Console (email adress).
Hope this helps!
I want to use Google Analytics to collect more information about the use of my applications, how to add Google Analytics to my Android application?
That's was made very easy now a days by Android Studio guys.
i. create analaytics id from Google analytics, sign in to your google analytics account. In the home page -> choose admin -> property column ->click the first dropdown - > press create new property.
ii. In this create property screen you are going give information like whether you need analytics id for website/app, fill information you will get an tracking id.
iii. open your android studio -> your porject - > right click project name- > open module settings -> choose google analytics -> it will list the property name which you have just created, select and click okay. (It will add needed dependencie files)
That's it, you are done add events with trackers to your project.
I always like to start with a sample, you can try the Google Analytics sample first, you can download it from here.
In order to run it, you have to download a json file and add it to your project's 'app' folder, you can get that from here.
Basically just have to follow this (in comment) page with the sample you successfully build, you should be good to go. It's surprisingly simple to implement specially if you worked with other google services before, good luck!
This might be a stupid question but I am facing an issue when trying to generate my google-services.json file for my app. I am following this guide from the google developers team to setup my project for analytics but when I click on the get configuration file button nothing happens, I just get a loading spinner that never ends.
I tried on different browsers, it's still the same. I checked the chrome console and got :
Refused to display 'https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…3Dtrue%26cntlbl%3DContinue%2BAdding%2BAnalytics%26cntapi%3Danalytics&hl=en' in a frame because it set 'X-Frame-Options' to 'DENY'.
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://console.developers.google.com') does not match the recipient window's origin ('null').
Any suggestion?
You are trying this link while configuration https://developers.google.com/analytics/devguides/collection/android/v4/start
So please do the following steps
Click on the GET A CONFIGURATION FILE
Now Choose your App Name.
Click Configuration Services
After that the 3rd Window will be open
Now Choose your Analytics account of your Apps.
Hurry you have done.
Please use all the process and done as it is you can do it.
Let me know if still you have any problem.
Well well, got a workaround. You console log helped: I clicked on the URL in the log ("https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…3Dtrue%26cntlbl%3DContinue%2BAdding%2BAnalytics%26cntapi%3Danalytics&hl=en") and it led me to the right page and I have been able to generate a google-services.json for my app.
A guy from Google analytics team suggests the solution here.
Try going through this website to get your configuration file - its the one for Cloud Messaging but it has a button that says "GET CONFIGURATION FILE":
https://developers.google.com/cloud-messaging/android/client
Also I did experience the same problem last week sometime when configurating cloud messaging myself but it seemed to have resolved itself in the afternoon so it could just be a one day error thing.
Steps for getting configuration if your first time login to google developer account.
open google developer console.
login to developer console.
create project with valid name.
then goto the API section & enable GCM API.
Then get the configuration file.
I have two Google Analytics accounts A and B, each with their own properties which I am attempting to generate configuration files for (more specifically, google-services.json files) in order to use Google Analytics with my Android app. I'm using the Enable Google Services for your app wizard.
When you reach the Choose and configure services step, it should allow you to choose both a Google Analytics account and an Analytics Property from their associated selection boxes every time you run this wizard. The problem is that the selection box for choosing a Google Analytics Account only appears on the first run of this wizard, and afterwards becomes a pre-filled field that cannot be modified.
This means that if I generate a configuration file for a Property using Account A, I cannot generate another configuration file for a Property using Account B since the wizard pre-fills a non-modifiable text box with Account A, and only Account A's Properties appear in the next selection box.
How can I generate a google-services.json configuration file for a Property under a Google Analytics Account I cannot switch to?
I have admin access to both of these accounts, so this is not an issue.
The configuration file is necessary for Google Analytics to work once the app is released to the public (as described here).
Similar unsolved questions have been asked here for Android and here for iOS (both platforms use the same wizard to enable the Google Analytics service).
Managed to figure out a very simple workaround to solve my own question: remove yourself from the account you're stuck on, so the wizard is then forced to let you choose another account.
To achieve this:
Log into Google Analytics and choose the Admin tab.
In the ACCOUNT column, from the drop-down box, choose the account you were bound to (in the Enable Google Services wizard).
In the same column, choose User management.
Click the Remove myself from this account button.
Then go back to the Enable Google Services wizard again and you should now be able to select another account.
I hope this helps others at least until Google fixes the site, as this was a rather annoying problem to solve!
I figure out the solution for this issue is that we can move the account to trash. After we create an config file, restore the account.
Hope this may help
On this page Google staff gave an answer to this bug:
This is currently working as intended even though it may not seem so. There may be an update to fix this but in the meantime you can just copy an existing Configuration file and edit it. The only thing you need to change is the Analytics tracking ID value.
For example, in the configuration JOSN file you'll see an entry like:
"services": {
"analytics_service": {
"status": 2,
"analytics_property": {
"tracking_id": "UA-XXXXX-YY"
}
},
Replace the UA-XXXXX-YY value with the property ID (for the GA
Account) you want to use. You can use the Account Explorer to find the
correct property ID:
https://ga-dev-tools.appspot.com/account-explorer/
Note that Tracking ID and Property ID mean the same thing.