Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transitioning from Google Analytics to Counterscale: Implementing OSS Analytics Across Android, iOS, and PWA #64

Open
xuelink opened this issue Apr 13, 2024 · 4 comments

Comments

@xuelink
Copy link
Contributor

xuelink commented Apr 13, 2024

I'm interested in transitioning from Google Analytics to an open-source solution, and Counterscale seems to meet my requirements. However, I have three clients: Android, iOS, and a Progressive Web App (PWA) for our OSS project. And we have discussed here about counterscale in our DG server if you are intetested in: invitation

Eventually we have decided to implement it and test it: langx/langx#653

For the PWA (web app), implementing Counterscale should be relatively straightforward. However, I've previously integrated Google Analytics into my native Android and iOS apps by importing the 'google-analytics.plist' file or similar resources as data sources.

My concern is how to replace this setup with Counterscale. Is it feasible to collect data from native iOS and Android devices using Counterscale? If so, what would be the process? Do you have any documentation, references, or examples that could guide me through this?

@benvinegar
Copy link
Owner

That's exciting – just a note about this disclaimer in the README:

NOTE: Counterscale is currently in very early development and shouldn't be used in any actual production setting.

I just want to highlight that this isn't version 1.0 yet. I think it's "stable" in the sense that the infrastructure will stay up just fine and not cause you any maintenance burden from general operation. But the software will change.

My concern is how to replace this setup with Counterscale. Is it feasible to collect data from native iOS and Android devices using Counterscale? If so, what would be the process? Do you have any documentation, references, or examples that could guide me through this?

Counterscale has a single HTTP ingestion endpoint that processes the analytics data emitted from the client (tracker.js).

I'd be happy to document the endpoint in the README. But you'd have to figure out how to populate the endpoint with the relevant data from these different environments. I'm afraid I don't have any real iOS or Android experience that would be helpful, and I should add I didn't build this with any consideration for it being used outside of a web context (though I imagine it could).

@xuelink
Copy link
Contributor Author

xuelink commented Apr 13, 2024

@benvinegar, I appreciate your kind and detailed explanation. No worries, I'll take a stab at sharing my experiences. It might yield some useful feedback!

Today, i forked this repo and implemented for several projects today: https://insight.langx.io/dashboard
1- https://langx.io tagged as website
2- https://token.langx.io tagged as token-website
3- https://insight.langx.io tagged as insight
4- web-app, ios and android tagged as app

Let's see how it reacts but the initial impression is that the dashboard opening is slow.
If everything is ok then i should upgrade my free tier in CF because of following screenshot
Screenshot_2024-04-12_at_11 51 18_PM

@benvinegar
Copy link
Owner

Let's see how it reacts but the initial impression is that the dashboard opening is slow.

I'm feeling that too on counterscale.dev. It basically queues up like 8 simultaneous queries (in parallel) and if any of them are slow the whole thing will wait.

I think this recent change is affecting things negatively: 956163c

Going to do some more analysis and figure out if it's the cause, and if so, revert.

@benvinegar
Copy link
Owner

benvinegar commented Apr 14, 2024

Perf issues documented in #68

Playing around, I don't feel 956163c is the cause. Even queries with low intervals (e.g. 7 days) can randomly just take 10 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants