google analytic technical: gif request & options for web apps - google-analytics

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.

Related

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.

Embed google analytics benchmarking report on 3rd party website

I am currently busy with embeddig a Google Analytics dashboard on a third-party website. I've already made a server-side authorization work and I'm able to display some google analytics data.
Now I'm wondering if it's possible to query google analytics benchmark data and show it on third-party website.
It doesn't look like Google Analytics benchmark data is available through the API.
Check this query explorer for the possible query parameters through the GA API.
As a workaround, you could either manually pull a csv report from GA, or write an automated script that can do this, depending on what you need.

Google Analytics Demo

I'm trying to find a web site/resource that has a working demo of Google Analytics to use.
As I have no website etc to be able to link my Analytics account to, I have no way of reviewing/learning to use Google Analytics.
Is anyone aware of such a demo available to the public?
Are you're asking for is a site where you can see GA working?
Years ago I set up 3 unusual but extremely effective GA learning sites mainly for myself (so they are crude).
I still use 2 of them today with Real Time reporting and Chrome extensions dataSlayer & WASP.
They accept your own Web Property ID (UA-xxxxx.yy) and save it in a cookie so the data goes into your own account.
Captures data to be sent to GA.
It's currently at http://cyclonal.com.
It still uses Classic GA (_gaq) - any offers to upgrade it to Universal gladly accepted
I also cloned a site used by the GA Dev team's (with permission)
It tested almost every feature of GA at the time.
Which is at http://cyclonal.com/g (has a history of the site link in the footer)
Finally, and probably what you may want to clone/create yourself, is a free form version of the concepts behind the above sites at http://cyclonal.com/sandbox/codeExec
Let me know if that works for you.
Google team released a Google Analytics demo account: https://support.google.com/analytics/answer/6367342?hl=en#access You can start "playing" with this account to get familiarized with google analytics api!

Google Analytics Dashboard for Different Sites

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.

Google analytics with a Chrome Web store packaged app

I have a couple of small packaged apps on the Chrome Web Store (that's packaged, not hosted, so I'm not hosting anything myself). I was wondering whether I can still use Google Analytics, and how to test whether it's working before publishing the app.
I'm guessing the answer might be no, because their FAQ just says this:
"Can I use Google Analytics?
Yes. Hosted apps use Google Analytics just like any other website does. For help on using analytics in packaged apps (and extensions), see this tutorial."
Anyone know if there's a way around this?
Resolution
Followed the advice from the answer, but with a couple of small differences. First, I did not modify in any way the code that I copied from GA. Second, I pasted my GA ID in the app publishing form in my developer dashboard (go to developer dashboard, click edit for the app in question, then find the GA field).
I hope this might help: http://code.google.com/chrome/extensions/tut_analytics.html
I recently submitted an app and found that there is a text field for adding your Google Analytics code.

Resources