Google Analytics Dashboard for Different Sites - google-analytics

I have a small multitenant application and I want to use google analytics to track the different minitenants. Tutorials on this topic seem to be pretty scarce, but I was wondering how I would go about
1) Rendering the dashboard for each 'site'
2) Allowing the creation of new sites for google analytic 'sites' automatically.
Using a 'global' Google account.
Any help would be very much appreciated.

For building dashboards to report on the analytics of your various sites/properties I would recommend using the Embed API to get started quickly. But since you stated you are interested in also managing Google Analytics properties programmatically. It might be useful go through the quick start guide for the language and application type of your choice. Python Service account or a PHP Web App, the list goes on.
But if you need to actually provision new accounts for each end user there is also the Google Analytics Provisioning API. There are restrictions on who is allowed to use that API, namely you need to be AdWords Channel Partner.

Related

how to hide conversions and revenue sections in Google Analytics Reports

I am in a need of sharing a Google analytics access of my website to a developer and want to hide revenue and conversions sections in Google Analytics account/property/view.
any guidance how is it possible to do that?
if you want to share access to the report in Google analytics web application then the simple answer is you can't, access to a Google analytics account is all or nothing
you could grab the data for them through the API using a service account and design your own reports display of the data
It is not possible to give visibility to only some sections or metrics of a view. You can use API (like said to DalmTo) or more simple to provide data with an external dashboard, for example with Google Data Studio, which fetches data from your Google Analytics and shows only the ones you want to share.

Tracking mobile web app with Google Analytics using the website script

I have built a web app (read: a website within a naitive app container) for iOS and Android. I started by adding the website script provided by Google to my app, figuring it would work since it's basically a website hosted within a container. The issue? Well, it doesn't work.
When I access the app from my phone, all I get within the Analytics GUI is that there is a user at page / nothing else despite how many pages I go to. I get the same result if I just browse to the website on my phone. However, if I go to the website on my computer, the script seems to pick up everything perfectly. I can see all pages I've visited and when, for example.
So I guess I have two questions:
Why doesn't the script work as expected through the app on my phone, but perfectly when accessing the webiste on my computer from a technical point of view? Does Google perform some sort of blocking regarding the request headers?
Is there any way to get the website script to work within an app or do I have to use Firebase for long-term and sustainable tracking?
Have in italics since the feeling I get when reading here is that the Google Analytics Services SDK for Android and iOS will probably be phased out sooner or later. According to this post the GA SDK is already deprecated. So using that doesn't really feel like an alternative.
Also, I am not interested in comments like "Why don't you use this analytics tool instead", or, "What's your problem with Firebase? Just use it".
There are two types of Google Analytics accounts. Web accounts and mobile accounts. Web accounts run off of pageview hits. Mobile accounts run off screenview hits. If you insert a screenview into a web account the only thing you will see is page / because its sending the in correct hit type.
The SDK is used for tracking mobile applications so it inserts screen views. You cant use the same Google analytics account for tracking with it your going to need a mobile Google analytics account if you want to use the SDK. You wont of course be able to analyse between the web and mobile accounts.
Cant help with firebase sorry.

google analytic technical: gif request & options for web apps

I want to build own analytic platform base on google analytic (GA).
So I had a quick investigation on GA.
But I have some misunderstand below:
In the website and web apps field, google analytic give three options: gtag.js, analytic.js, AMP HTML. But I don't know what will I choose whichever. or could you help me point out the case that we will use for each option?
I tried to follow gtag.js, debug and realize that google analytic send a gif request to post data to google analytic server. I think they use this way to avoid cross-domain Ajax. But the question is how they send data to google server by Android/IOS sdk? They still used gif request or normal restful api.
If anyone know or have idea please help and sharing to me.
Thanks in advance
Jame
gtag.js (global tag) is the current version of Google tracking code - "global" because it aims to provide a unified tracking code for Analytics, Adwords, and other Google products.
With the release of the gtag libary analytics.js is now the legacy version of the Google Analytics Javascript tracker, so currently most available information refers to that. However if you are getting started with Analytics you probably should use the current version.
AMP are accelerated mobile pages, a special format with reduced markup and scripting options that is cached on and delivered from Google servers (you relinquish control over your pages in favour of faster delivery, basically). If you have to ask what this is then you are not using it, and do not need this type of tracking code.
If you use Google Analytics in a mobile website you'd use the Javascript tracker and that will indeed return a gif.
If you want to track a native App you would, these days, use Google Analytics for Firebase which comes with it's own SDK. You would implement Firebase in your App and then connect the Firebase project to a mobile property in GA.

Embed Google Analytics existing dashboard

In the Google Analytics console I can easily create charts and add them to dashboards. But how can I display those charts or dashboards on a 3rd party website?
I've seen the Embed API, but it looks like the definition of the reports is always in the Javascript. Is it not possible to say something like display the dashboard that I already created which name/id is XYZ?
Or is there a way, when creating a report in Google Analytics, to get its definition so that I can easily use it? I saw Query Explorer but it doesn't help.
No you can not take the Google Analytics dashboard and display it on another website.
The best option there is to date is the Embedded API which you mentioned. Although it has its limitations. The Embedded API is designed to display a specific users Google Analytics Dashboard who ever is logged in. If you are trying to share the information from your account with other users it wont work unless they also have access to your Google Analytics account.
The Query Explorer shows you what the google Analytics API is capable of. You can develop your own tool to show this information to your users.

How can Google Analytics be used to track the different websites within a homegrown CMS?

I own and operate my own Content Management System (CMS) web application targeted at a specific type of customer (schools). Each customer wants to track the traffic to their own website. Of course, I could ask them to each create their own Google Analytics account and then provide me with the tracking ID so that my CMS can embed the correct code onto their pages. But I was wondering if there was a better way ... something more automated, and something that involves less work on their part.
I was thinking that for each customer, I could use the Google Analytics APIs to automatically create a new Property with the appropriate filter and then give the customer "Read & Analyze" permissions for that property. The problem with that is that I'm limited to creating 50 properties under my account.
Any other ideas? I'm just wondering if I'm missing some feature of GA that is specifically designed for this scenario.
Thanks,
Rajeev
Asking each user to create their own analytics account is the correct solution. Then they should just give your cms the id, and then your cms should include the correct analytics javascript code. It's the way all other cms systems supports Google Analytics

Resources