mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-13 19:37:47 -05:00
Support Matomo and Google analytics #21
Closed
opened 2025-11-02 03:04:27 -06:00 by GiteaMirror
·
28 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1.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v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
type/feature
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#21
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joubertredrat on GitHub (Nov 3, 2016).
Hi guys,
I think that Gitea can have support to Piwik or Google analytics. What you think?
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38917746-support-to-piwik-and-google-analytics?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github).@xinity commented on GitHub (Nov 3, 2016):
@joubertredrat what would piwik or analytics benefits for ?
@joubertredrat commented on GitHub (Nov 3, 2016):
@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 https://github.com/gogits/gogs/issues/3004 instead this, but can be dangerous if Gitea owner not understand about javascript.
@tboerger commented on GitHub (Nov 3, 2016):
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.
@xinity commented on GitHub (Nov 3, 2016):
@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
@bkcsoft commented on GitHub (Nov 4, 2016):
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 🙂
Reference: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md
@joubertredrat commented on GitHub (Nov 4, 2016):
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.
@jag3773 commented on GitHub (Nov 29, 2016):
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.
@tboerger commented on GitHub (Nov 29, 2016):
That's only the first step, it also needs snippets within the templates. And beside that we don't want to add Google only
@jag3773 commented on GitHub (Nov 29, 2016):
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.
@joubertredrat commented on GitHub (Nov 29, 2016):
@jag3773 make PR with this changes that I make PR with Piwik implementation.
@strk commented on GitHub (Nov 30, 2016):
Couldn't this be done with simple custom templates by administrators ?
@strk commented on GitHub (Nov 30, 2016):
As in... I'd rather not advertise proprietary services from Gitea official code repository...
@tboerger commented on GitHub (Nov 30, 2016):
We will add options for piwik and Google as it's pretty common. Nobody is forced to enable these options.
@joubertredrat commented on GitHub (Nov 30, 2016):
@strk Piwik is open source analytics.
@strk commented on GitHub (Nov 30, 2016):
Thanks Joubert, than I see no problem with adding support for Piwik.
@bkcsoft commented on GitHub (Dec 6, 2016):
@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 🙂
@strk commented on GitHub (Dec 6, 2016):
On Tue, Dec 06, 2016 at 10:18:16AM -0800, bkcsoft wrote:
That's a bug, like the Gravatar advertisement...
@tboerger commented on GitHub (Dec 6, 2016):
It's not a bug, it's intentional. Not everybody is so fanatic...
@denji commented on GitHub (Dec 17, 2016):
Open web analytics in Golang & Preact https://github.com/dannyvankooten/ana
@cez81 commented on GitHub (Apr 3, 2017):
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
c64b842df9 (diff-675f585d9cd6a202ba88a50dc67e52ff)@lolusxy commented on GitHub (Aug 31, 2017):
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
@lunny commented on GitHub (Sep 1, 2017):
You can do it via custom templates
@tboerger commented on GitHub (Sep 1, 2017):
For a proper integration we should provide templates that get included if piwik or analytics are configured via app.ini
@lolusxy commented on GitHub (Sep 1, 2017):
@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.
@lunny commented on GitHub (Jun 8, 2018):
Since We supported header.tmpl and footer.tmpl, this maybe closed since https://github.com/go-gitea/gitea/pull/3051
@ptman commented on GitHub (Jun 8, 2018):
But wouldn't it make sense for this to be a couple of settings in app.ini instead of modifying templates?
@techknowlogick commented on GitHub (Jun 8, 2018):
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).
@bkcsoft commented on GitHub (Jun 17, 2018):
I agree with the above, that injecting analytics should be done using custom templates from #3051