Git Product home page Git Product logo

Comments (28)

tboerger avatar tboerger commented on May 23, 2024 2

It's not a bug, it's intentional. Not everybody is so fanatic...

from gitea.

lunny avatar lunny commented on May 23, 2024 2

Since We supported header.tmpl and footer.tmpl, this maybe closed since #3051

from gitea.

strk avatar strk commented on May 23, 2024 1

from gitea.

denji avatar denji commented on May 23, 2024 1

Open web analytics in Golang & Preact https://github.com/dannyvankooten/ana

from gitea.

cez81 avatar cez81 commented on May 23, 2024 1

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.

xinity avatar xinity commented on May 23, 2024

@joubertredrat what would piwik or analytics benefits for ?

from gitea.

joubertredrat avatar joubertredrat commented on May 23, 2024

@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.

tboerger avatar tboerger commented on May 23, 2024

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.

xinity avatar xinity commented on May 23, 2024

@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.

bkcsoft avatar bkcsoft commented on May 23, 2024

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.

joubertredrat avatar joubertredrat commented on May 23, 2024

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.

jag3773 avatar jag3773 commented on May 23, 2024

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.

tboerger avatar tboerger commented on May 23, 2024

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.

jag3773 avatar jag3773 commented on May 23, 2024

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.

joubertredrat avatar joubertredrat commented on May 23, 2024

@jag3773 make PR with this changes that I make PR with Piwik implementation.

from gitea.

strk avatar strk commented on May 23, 2024

Couldn't this be done with simple custom templates by administrators ?

from gitea.

strk avatar strk commented on May 23, 2024

As in... I'd rather not advertise proprietary services from Gitea official code repository...

from gitea.

tboerger avatar tboerger commented on May 23, 2024

We will add options for piwik and Google as it's pretty common. Nobody is forced to enable these options.

from gitea.

joubertredrat avatar joubertredrat commented on May 23, 2024

@strk Piwik is open source analytics.

from gitea.

strk avatar strk commented on May 23, 2024

from gitea.

bkcsoft avatar bkcsoft commented on May 23, 2024

@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.

lolusxy avatar lolusxy commented on May 23, 2024

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.

lunny avatar lunny commented on May 23, 2024

You can do it via custom templates

from gitea.

tboerger avatar tboerger commented on May 23, 2024

For a proper integration we should provide templates that get included if piwik or analytics are configured via app.ini

from gitea.

lolusxy avatar lolusxy commented on May 23, 2024

@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.

ptman avatar ptman commented on May 23, 2024

But wouldn't it make sense for this to be a couple of settings in app.ini instead of modifying templates?

from gitea.

techknowlogick avatar techknowlogick commented on May 23, 2024

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.

bkcsoft avatar bkcsoft commented on May 23, 2024

I agree with the above, that injecting analytics should be done using custom templates from #3051

from gitea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.