Tracking mobile web app with Google Analytics using the website script - google-analytics

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.

Related

How should I track a mobile app landing page with firebase / google analytics

Right now I have a mobile app with both ios and android version using firebase.
Users and events tracking is done with firebase.
The firebase account is also linked to google analytics for better reports and analytics.
I can add inside both firebase and analytics a web tracking source which would be a third tracking source for this case.
But since I want to track a landing page and not a web version of my mobile app I feel that doesn't correspond to my use case.
What I would want is to be able to tell how many of my users downloaded the app by clicking on the landing page download button.
I also would also like to be able to track how users got on the landing page.
For example I would like to have stats on how many views and app download a post on a specific blog or a specific ad generated.
I though this would be quite simple to setup with firebase / google analytics but I'm not so sure anymore.
If I add my landing page as a third web tracking source, I actually think it will affect the stats of my mobile app usage.
Does someone here had the need for something similar ?
How did you set your landing page tracking ?

Do firebase dynamic links work with PWA applications?

Firebase dynamic link documentation does not show Web as a category it supports but I wanted to know if there is any hack out there where can get it to work for PWA applications? the google analytics tracking for firebase is a powerful feature, especially for dynamic links.
Even though there is no specific API for this, since Dynamic Links are just URLs, you can indeed use then within a web app.
For example, we used them in the PWA for the Firebase Summit in 2018 to track click-throughs to the additional information for each session.
If you are having issues with your PWA not running correctly in Facebooks (insert expletive) Mobile Browser. Using dynamic links will force it out to the regular browser)
Do not use a custom domain, use the https://YOURDOMAIN.page.link
and DO NOT skip the preview page!

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.

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.

how to track Google Analytics of Adobe Air app?

I have written an Adobe Air desktop application that tracks a bunch of websites and displays images from the websites in the app. And instead of keeping my mouth shut about it and making it look like an attack on the website, I'd like to make it so that the webmasters can see that these pageviews are made by my application.
Is there any way the webmaster could distinguish adobe air access of the website from normal visitor browsing? Perhaps by adding something to the URLrequests I make in the application..?
Google analytics captures browser settings. Make your app pass a unique user-agent, thus any visit with your app could be separated from everything else.

Resources