bork
bork

Reputation: 1674

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:

  1. 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?
  2. 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".

Upvotes: 0

Views: 314

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117196

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.

Upvotes: 1

Related Questions