Google Analytics demo/sandbox account - google-analytics

I am working on a custom dashboard with React and Node that uses the Google Analytics API. I want to use a demo account to test how it works. Is there a way to achive that? I found this page but it explicitly says that it cannot be used with the API. Thank you!

You cannot use Google Analytics API whit Demo Account of Google Merchanding store. You have to use your own Property or create a new one and send hits with measurement protocol to populate some data.

Related

Can't retrieve Google Analytics for Firebase through API

I integrated my Firebase to my Google Analytics account by following this link. Now I can see my custom event in Google Analytics.
I managed to use the Google Analytics reporting v4 API to retrieve data for my web site because there is a View like indicated in the figure below :
I would like to use the same API to retrieve data in Google Analytics for Firebase. However, when doing the integration, no view is created like shown below :
I can't manage to find a link or a documentation to do it. Can help me about that ?
PS: I saw that it is possible to export Firebase data through BigQuery, however, I would like to avoid this possible if possible.
Regards and Thanks
Yassir,
It looks like your last screenshot shows a GA4 property, since it does not have any views. You can use the Google Analytics Data API to access GA4 properties.

Basic idea of Firebase + GTM, is Google Analytics completely necessary?

I'm somewhat confused about the flow of data in this integration, do I need a GA account to make use of GTM's functionality, or can I just keep the tags inside GTM/send them back to firebase?
I'm an iOS developer and need to tag my already existing firebase events in GTM, but not sure if I'm understanding the big picture here.
Thanks in advance!
You don't need to send data to Google Analytics. In fact, Firebase tags in GTM don't have any field where you can insert the Property ID of Google Analytics. Using them you send the events to the Firebase project that you have configured in its console.

Google analytics using REST api

I want to add Google analytics manually on each pages and events in my website. Is there any ways to add Google analytics using REST api or any library in PHP. so i can track specific events of my website.
There is no REST API for Google Analytics. You will have to use one of the available libraries provided by Google.
To track particular events, you can use tag manager or simply use custom dimensions.
TL;DR, Google Analytics is great if all you ever use is their GUI dashboard. If you need API access, go with another service.
If you need to access analytics data programmatically, especially if you are using NodeJS, I suggest you use some other service besides Google. Their documentation is incredibly lacking, they try to pigeon-hole you into using a client library rather than steering you in the direction of a REST API, and authenticating is a nightmare. The new v4 API purportedly consists of a single endpoint that you need to query with a complex combination of HTTP body and query params. Again, documentation is nearly non-existent.

Google analytics Embeded api with out Oauth authorize

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.

It is possible to create a script for generating new sites on a google analytics account?

I need to create a script (php for example) to generate new sites on a google analytics account.
I need to obtain the ID of the generated site.
¿It is possible to do it? How can i achieve it?
Thanks
No. All of the Google Analytics APIs are read-only. The only way to create new accounts is manually.
As #jk added below, from the Google Analytics Management API docs:
Google Analytics provides developer access to the configuration data
through the Management API, which is a read-only API for account and
configuration data.

Resources