Remove Google Analytics script loader - #213
Open
Hathor875 wants to merge 1 commit into
Open
Conversation
Strips the GA script injection from Analytics.js. The public API is retained as no-ops so the existing call sites across the editors keep working; removing those follows in a separate change. Refs Euro-Office#82 Signed-off-by: Krzysztof Cieślik <132496025+Hathor875@users.noreply.github.com>
Hathor875
requested review from
Alex-Arsys and
MonaAghili
and removed request for
a team
August 22, 2026 23:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove Google Analytics script loader
Strips the GA script injection from
apps/common/Analytics.js. The public API isretained as no-ops so the existing call sites across the editors keep working;
removing those follows in a separate change.
Refs #82
What changed
initialize()no longer appends the inline<script>that seeded_gaqandpulled in
google-analytics.com/ga.js. Both methods are now empty.validate. Callers that passed a bad type used to get a
throw; they now getsilence, which is the intent: no call site should have to care.
$('head')was this file's only jQuery dependency, so the module no longertouches the DOM or any global beyond
window.Common.Why the call sites stay
rg -i analytics apps/ --glob '!vendor'returns ~530 hits across the threeeditors. Removing them is mechanical, but folding it into this commit would bury
the handful of lines that actually matter behind a diff nobody can review. The
no-op shims keep every one of those call sites working, so this change stands on
its own and cannot break a build. The call-site cleanup lands separately.
The loader was already dead
initialize()is guarded by&& falsein each editor'sMain.js, soga.jswas never injected in the first place. This commit removes code that had already
stopped running — it is not a behaviour change for users, only a removal of the
dead path and the third-party URL baked into it.
Relation to #85
#85 does this in full — loader, call sites,
canAnalyticsflags, build config,HTML loaders (74 files,
+12 −781). It is the better end state and stays open;I will close this if it lands.
It is not mergeable today: open ~2 months, no review, no CI, and
mainhas moved165 commits since — including Grunt → webpack. It edits
build/appforms.jsonandbuild/Gruntfile.js, which no longer exist, so it cannot be rebased. This changetouches one file for that reason, and removes the part that carries the risk.
Testing
node --check apps/common/Analytics.js— clean.global.window = global) and calledtrackEvent()beforeinitialize(), theninitialize(), thenCommon.component.Analytics.trackEvent()— no throw, and both aliases stillresolve to the same object.
rg "_gaq" apps/ --glob '!vendor'— no matches.test/unit-tests/common/index.html(per test(unit-tests): make the harness runnable again #194): 12 passing, unchanged. Notethe harness has no coverage for this file —
rg -i analytics test/is empty —so it confirms no regression elsewhere, not that this file works.