Comments (28)
It's not a bug, it's intentional. Not everybody is so fanatic...
from gitea.
Since We supported header.tmpl and footer.tmpl, this maybe closed since #3051
from gitea.
from gitea.
Open web analytics in Golang & Preact https://github.com/dannyvankooten/ana
from gitea.
Would it be good enough to do it same way as Gogs?
https://discuss.gogs.io/t/how-to-inject-custom-head-and-footer/943
gogs/gogs@c64b842#diff-675f585d9cd6a202ba88a50dc67e52ff
from gitea.
@joubertredrat what would piwik or analytics benefits for ?
from gitea.
@xinity for general purpose is only to see visitors logs, mine case in specific I scale my gogs instance vertically based on visitors reports and instance performance (cpu, memory, hd).
Personally I prefer gogs/gogs#3004 instead this, but can be dangerous if Gitea owner not understand about javascript.
from gitea.
IMHO this is a pretty common use case for hosted services, so we should provide two simple config options, one for piwik and one for google analytics, without modifying the custom templates.
from gitea.
@joubertredrat i see thanks for the update.
indeed for hosted services that would use gitea it could be nice to have this kind of feature
from gitea.
Maybe allow to inject custom js-scripts at the bottom of template/base/footer.tmpl
? That way we don't need to maintain the function ourselfs 😅 and people using other analytics-services can easily inject their own 💯
After that one could extend it to have a few "default" scripts (such as GAnalytics/Piwik) to choose from 🙂
Please keep the change in a single MR as small as possible. If you want to contribute a large feature think very hard what the minimum viable change is. Can you split the functionality? Can you only submit the backend/API code? Can you start with a very simple UI? Can you do part of the refactor? The increased reviewability of small MRs that leads to higher code quality is more important to us than having a minimal commit log. The smaller an MR is the more likely it is it will be merged (quickly). After that you can send more MRs to enhance it.
Reference: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md
from gitea.
yes @bkcsoft, can be defined templates for piwik, GA and if you define idSite for piwik or UA for GA on config, Gitea add this templates on render and set code into then.
from gitea.
We've implemented support for GA like this https://github.com/unfoldingWord-dev/gogs/pull/97/files . We can issue a PR for this if it's useful for others here.
from gitea.
That's only the first step, it also needs snippets within the templates. And beside that we don't want to add Google only
from gitea.
Indeed, we keep our templates in a separate repository, so the rest of the change is actually in here. Also, if you take this approach it might make sense just to have a separate config for GA and Piwik.
from gitea.
@jag3773 make PR with this changes that I make PR with Piwik implementation.
from gitea.
Couldn't this be done with simple custom templates by administrators ?
from gitea.
As in... I'd rather not advertise proprietary services from Gitea official code repository...
from gitea.
We will add options for piwik and Google as it's pretty common. Nobody is forced to enable these options.
from gitea.
@strk Piwik is open source analytics.
from gitea.
from gitea.
@strk we already "advertise" Slack, IMO as long as we don't include closed-source (never will, but still) we should be fine 😛
With that said, I do agree that this could be done with custom templates instead and should not go into gitea itself 🙂
from gitea.
Is it just this line we have to add?
https://github.com/gogits/gogs/blob/v0.10.1/templates/base/footer.tmpl#L55
Can we please do it? Seems simple
from gitea.
You can do it via custom templates
from gitea.
For a proper integration we should provide templates that get included if piwik or analytics are configured via app.ini
from gitea.
@lunny
Yeah, thats probably what I am going to do.
But I have to update my custom template every time the original file updates. Gogs' inject solution seems more elegant and simple to add.
@tboerger
That would be the best solution but a lot more complex to add.
from gitea.
But wouldn't it make sense for this to be a couple of settings in app.ini instead of modifying templates?
from gitea.
I think due to how often Google changes their embed (from classic GA, to asynch GA, to now Google Tag) this is better left as an exercise for the user instead of having to closely follow what Google does. Also if we tie GA to a specific version and a user adds additional tracking code (such s onclicks for event tracking) then if we upgrade GA to the latest embed code we risk breaking that for the user).
from gitea.
I agree with the above, that injecting analytics should be done using custom templates from #3051
from gitea.
Related Issues (20)
- Tag name rules
- Sort tags by commit date
- Add `refs/pull/1/merge` reference for pull request to avoid the merged commit id missed.
- Debian Package Registry: duplicate key value violates unique constraint "UQE_package_version_s" HOT 1
- SIGSEGV when pushing sha256 repository HOT 8
- home page title overflow
- Gogs migration tool HOT 3
- Revise server side hook configuration to support dynamic hook file extensions. HOT 2
- Merged PR should hidden time tracker? HOT 1
- No operation for a long time, no response HOT 2
- Data race during testing HOT 3
- Option to skip issue details in /times endpoints reply HOT 1
- Server misbehaving when trying to push/pull/login to docker registry HOT 16
- Conan: invalid literal for int() with base 10: '' HOT 2
- Render xlsx same as docx HOT 2
- Difference between github and gitea actions when running contains(needs.*.result, 'success')
- Add a more obvious approve button for MRs HOT 2
- Support itch.io OAuth2 provider HOT 6
- Large uploads fail in web client HOT 3
- Deleted branch still visible in branch list and 404 on access HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitea.