-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Feature - Added Optional Google Analytics tag for Status Page. #2567
Conversation
I am thinking, maybe we should use sever side rendering instead. As the code have to put at beginning of |
Sounds good, I'll refactor it into server/status_page.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing new i18n keys
3194f48
to
7b36bfc
Compare
63e3ea7
to
01456bc
Compare
60a48cd
to
760a61b
Compare
@@ -0,0 +1,4 @@ | |||
-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. | |||
BEGIN TRANSACTION; | |||
ALTER TABLE status_page ADD google_analytics_tag_id TEXT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be VARCHAR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed ✔️
My codes (GA3 and GA4) do not seem to be working, it is still empty after save.
|
Ah that's getting blocked by the regex, apparently that looks different than what the google ads site specifies, I'll make it a bit less restrictive, obviously they have used different formats at different points. |
Maybe remove this regex? Because Google will keep adding new code format which will be hard to handle in the future. |
A good shout I think. I've removed it and updated the database field type. |
7209db5
to
f153082
Compare
server/model/status_page.js
Outdated
@@ -53,6 +54,13 @@ class StatusPage extends BeanModel { | |||
|
|||
const head = $("head"); | |||
|
|||
if (statusPage.googleAnalyticsTagId) { | |||
let escapedGoogleAnalyticsScript = jsesc(googleAnalytics.getGoogleAnalyticsScript(statusPage.googleAnalyticsTagId), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think jsesc is wrongly used, as getGoogleAnalyticsScript()
returns with <script> tag which is not purely a javascript. I will fix it
Description
This PR adds in a Google Analytics tag field for a Status Page (allowing different tags for different pages/domains).
Fixes #2180 (issue)
Type of change
Checklist
(including JSDoc for methods)
Screenshots (if any)