Can we uses google analytics to analyze stats for our API? - google-analytics

I have APIs. My websites, my IOS apps, and other stuffs. We uses our own stats algorithm.
Then we think we should uses google analytics instead.
However, it's API. It's not a website. No javascript should be involved. We should contact google everything something happens. Just like in android and IOS app.
Can that be done?
Is google analytics the best way to do it?
The API uses php and asp.

I don't know about the best way to do it, but for GA you can use a Measurement Protocol:
https://developers.google.com/analytics/devguides/collection/protocol/v1/

Related

Is it possible to integrate Google Analytics in my JS library

I have a JS library which is used by some users. I am going to track some behaviours from user using the library. I tried to configure a property on Google Analytics, however, it seems I should configure a URL for a website, an ID for an ios or an Android application.
How can I use Google Analytics in my library? Or can GA be used for this purpose?
Thanks
Google Analytics is a web analytics tool. So you won't be able to track your JS library with GA.
If you Google “Google Analytics,” the description provided is as following:
Google Analytics lets you measure your advertising ROI and track your Flash, video, and social networking sites and applications.
JS libraries are not part of the use cases.
Also, Google “Track JS Library Google Analytics.” As you can see, you’ll only get references to libraries such as gtag.js or analytics.js, which will not serve your purpose of tracking your library.
And ask yourself, will people use your JS library when they know you are tracking them? I don't think so. Instead, create a repo on GitHub with documentation and allow users to report issues.
Also, create a mailing list with users and execute small surveys to understand better how people are using your JS library.

How to handle analytics on PWA when it is deployed both as an web app and an TWA in Play Store

How should I integrate analytics into a PWA webapp ? if I add analytics from google analytics into webapp and publish it in a server, then later, if I want to publish it on Google Play Store, how should I track the use?
here's the scenario:
I'm deploying the PWA from a subdomain.
then I'm publishing the PWA from Google Play Store as a TWA.
My concerns:
Should I use the google analytics snippet for web to track the subdomain-based pwa and firebase analytics for my Google Play Store app?
Or,
Can I use a single method to track both versions at the same time?
I have found this faq of chrome developer about use of google analytics
The CPA library follows the basic usage pattern of Google Analytics and will feel familiar to existing users of Google Analytics. However, unlike the web-centric official Google Analytics JavaScript libraries, the CPA library uses an "app-centric" model that is better suited for Packaged Apps. Among other features, the library provides methods for specific types of hits, such as "event" and "appView", and it can be used in both Closure-based and traditional JavaScript projects.
I am using Vuejs as frontend with pwa template, not sure if it is applicable for my use case. Any suggestion or direction would be much appreciated.
I am using THIS - Web + App configuration.
Using this you can track both at the same time.
You can configure it easily in firebase - see HERE for more

Google Analytics: tracking offline mobile apps

We're tracking our web apps using GTM (Google Tag Manager) and GA360 (the paid version of GA).
We also have hybrid mobile apps (mobile apps built with web frontend) that are intended for our users to work mostly offline (they are kind of reader apps).
I've been doing some research and there's a lot of information but I'm not sure yet of what's the best approach to connect my mobile apps to GA when they're mostly offline.
I've found Google Analytics for Firebase which is a free service but seems to be a separate service from GA and I would end up with half of the analytics in GA and the other half in Firebase.
I also read about using Workbox to support Offline Google Analytics:
https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics
What's actually the best approach for this kind of problem?
What service(s) can I use to solve this problem?
Thank you.
I'm not sure if either of the other two approaches mentioned above are better or even work in this context, but I wanted to mention a third approach, linked below.
It is not simple, involving writing custom google analytics calls to check online status, and either queue requests yourself when offline, or post them when online.
It should work well though, and end up keeping all of your analytics in one console.
Simo Ahava Blog: Track users who are offline in Google Analytics.

Google anlytics or Firebase analytics for web/native platforms?

Our app was hybrid app and we also have a website.
So we just used 'web' google analytics so far.
Now we are converting some pages to react native.
I see there are several options available for unified (web/native) reporting.
I'd like to use 'web' google analytics with react native if I could, but not sure if I could do that.
use screenview or pageview hit-type from both web and native, although I'm not sure If one could send pageview hit-type from native (or react-native)
connect firebase to GA (https://support.google.com/analytics/answer/2587086) not sure what it actually does.
use bigquery (https://cloud.google.com/solutions/mobile/mobile-firebase-analytics-big-query) although I don't want to go this route because it's seems too much work to set up..
How do you organize analytics when you have both web and app ?

Is there anyway to grab Google Analytics via some kind of API?

Basically I have an admin CP I've coded for all my sites and I'd love to integrate the information gathered by Google Analytics on it to avoid having to look at both sites every morning.
BTW I'm using PHP, but I would assume if something like this exists it would just be exported as XML.
Nope.
Here's how to use Yahoo Pipes to scrape your Analytics page
Alternatively, you can export reports and use them
There's an official API in private beta. I'm looking forward to it!
http://analytics.blogspot.com/2008/10/more-enterprise-class-features-added-to.html
Nicolas Lierman has developed an AIR application that uses an API of his own creation to gather Google analytics data. He refuses to puplish the API though as apparently it exposes some severe security flaws in Analytics interface. Google themselves have never published an API for it.
If you really want to proceed with your plan, you'll have to reverse engineer the interface yourself.

Resources