Skip to content

Commit c00dcd1

Browse files
committed
Merge branch 'release.24.10' into release.24.12
# Conflicts: # CHANGELOG.md # plugins/plugins/frontend/public/localization/plugins.properties
2 parents cf99b92 + 7e7ffed commit c00dcd1

File tree

6 files changed

+174
-130
lines changed

6 files changed

+174
-130
lines changed

bin/countly.install_rhel.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ cp "$DIR/config/supervisord.example.conf" "$DIR/config/supervisord.conf"
4848

4949
#Install raven-release for ipa-gothic-fonts required by puppeteer
5050
if [[ "$CENTOS_MAJOR" = "9" ]]; then
51-
sudo rpm -ivh https://pkgs.dyn.su/el8/base/x86_64/ipa-gothic-fonts-003.03-15.el8.noarch.rpm
51+
sudo rpm -ivh https://pkgs.sysadmins.ws/el8/base/x86_64/ipa-gothic-fonts-003.03-15.el8.noarch.rpm
5252
else
53-
sudo yum install -y https://pkgs.dyn.su/el8/base/x86_64/raven-release-1.0-3.el8.noarch.rpm
53+
sudo yum install https://pkgs.sysadmins.ws/el8/base/x86_64/raven-release-1.0-3.el8.noarch.rpm
5454
sudo yum install -y ipa-gothic-fonts
5555
fi
5656

frontend/express/app.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ plugins.setConfigs("frontend", {
136136
session_timeout: 30,
137137
use_google: true,
138138
code: true,
139-
google_maps_api_key: "",
140139
offline_mode: false,
140+
self_tracking: "",
141141
});
142142

143143
if (!plugins.isPluginEnabled('tracker')) {
@@ -157,7 +157,6 @@ plugins.setUserConfigs("frontend", {
157157
session_timeout: false,
158158
use_google: false,
159159
code: false,
160-
google_maps_api_key: ""
161160
});
162161

163162
plugins.setConfigs("security", {

frontend/express/public/javascripts/countly/countly.template.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3901,7 +3901,7 @@ Backbone.history.checkUrl = function() {
39013901

39023902
Backbone.history.noHistory = function(hash) {
39033903
if (history && history.replaceState) {
3904-
history.replaceState(undefined, undefined, hash);
3904+
history.replaceState(undefined, undefined, encodeURI(hash));
39053905
}
39063906
else {
39073907
location.replace(hash);

frontend/express/views/dashboard.html

+156-124
Original file line numberDiff line numberDiff line change
@@ -1887,148 +1887,180 @@ <h4><a href="#/analytics/events/key/{{encodeURIComponent this.name}}">{{this.nam
18871887

18881888
<script>Backbone.history.start();</script>
18891889
<% if (!offline_mode) { %>
1890-
<% if (!track || track == "GA" && member['global_admin'] || track == "noneGA" && !member['global_admin']) { %>
1891-
<!--Countly script-->
1892-
<script type='text/javascript' src='<%- cdn %>sdk/web/countly.min.js?<%= countlyVersion %>'></script>
1893-
<script type='text/javascript'>
1894-
1895-
Countly.getViewName = function(){
1896-
var view = "/dashboard#";
1897-
var fragment = Backbone.history.getFragment();
1898-
var parts = fragment.split("/");
1899-
if (fragment.indexOf("/analytics/retention/") === 0) {
1900-
parts[4] = ":event";
1901-
}
1902-
if (fragment.indexOf("/attribution/") === 0) {
1903-
parts[2] = ":campaign_id";
1904-
}
1905-
for (var i = 1; i < parts.length; i++) {
1906-
if (/\d/.test(parts[i])) {
1907-
parts[i] = ":id";
1908-
}
1909-
if (parts[i][0] === "{") {
1910-
parts[i] = ":query";
1911-
}
1890+
<!--Countly script-->
1891+
<script type='text/javascript' src='<%- cdn %>sdk/web/countly.min.js?<%= countlyVersion %>'></script>
1892+
<script type='text/javascript'>
1893+
1894+
Countly.getViewName = function(){
1895+
var view = "/dashboard#";
1896+
var fragment = Backbone.history.getFragment();
1897+
var parts = fragment.split("/").slice(0, 3);
1898+
if (fragment.indexOf("/attribution/") === 0) {
1899+
parts[2] = ":campaign_id";
1900+
}
1901+
if (fragment.indexOf("/users/") === 0 && parts.length === 3) {
1902+
parts[2] = ":user_id";
1903+
}
1904+
for (var i = 1; i < parts.length; i++) {
1905+
if (/\d/.test(parts[i])) {
1906+
parts[i] = ":id";
19121907
}
1913-
return view + parts.join("/");
1914-
};
1915-
1916-
Countly.getViewUrl = function(){
1917-
var view = "/dashboard#";
1918-
var fragment = Backbone.history.getFragment();
1919-
var parts = fragment.split("/");
1920-
if (fragment.indexOf("/analytics/retention/") === 0) {
1921-
parts[4] = "[CLY]_session";
1908+
if (parts[i][0] === "{") {
1909+
parts[i] = ":query";
19221910
}
1923-
if (fragment.indexOf("/attribution/") === 0) {
1924-
parts[2] = "";
1911+
}
1912+
return view + parts.join("/");
1913+
};
1914+
1915+
Countly.getViewUrl = function(){
1916+
var view = "/dashboard#";
1917+
var fragment = Backbone.history.getFragment();
1918+
var parts = fragment.split("/").slice(0, 3);
1919+
if (fragment.indexOf("/attribution/") === 0) {
1920+
parts[2] = "";
1921+
}
1922+
if (fragment.indexOf("/users/") === 0 && parts.length === 3) {
1923+
parts[2] = "";
1924+
}
1925+
for (var i = 1; i < parts.length; i++) {
1926+
if (/\d/.test(parts[i])) {
1927+
parts[i] = "";
19251928
}
1926-
for (var i = 1; i < parts.length; i++) {
1927-
if (/\d/.test(parts[i])) {
1928-
parts[i] = "";
1929-
}
1930-
if (parts[i][0] === "{") {
1931-
parts[i] = "{}";
1932-
}
1929+
if (parts[i][0] === "{") {
1930+
parts[i] = "{}";
19331931
}
1934-
return view + parts.join("/");
1935-
};
1932+
}
1933+
return view + parts.join("/");
1934+
};
19361935

1937-
if (countlyGlobal.countly_tracking) {
1938-
var domain = countlyGlobal.countly_domain;
1936+
if (countlyGlobal.countly_tracking) {
1937+
var domain = countlyGlobal.countly_domain;
19391938

1940-
try {
1941-
// try to extract hostname from full domain url
1942-
var urlObj = new URL(domain);
1943-
domain = urlObj.hostname;
1944-
}
1945-
catch (_) {
1946-
// do nothing, domain from config will be used as is
1947-
}
1939+
try {
1940+
// try to extract hostname from full domain url
1941+
var urlObj = new URL(domain);
1942+
domain = urlObj.hostname;
1943+
}
1944+
catch (_) {
1945+
// do nothing, domain from config will be used as is
1946+
}
19481947

1949-
//initializing countly with params
1950-
Countly.init({
1951-
app_key: countlyGlobal.frontend_app,
1952-
url: countlyGlobal.frontend_server,
1953-
device_id: domain,
1954-
app_version: "<%= countlyVersion %>",
1955-
interval:1000
1956-
});
1948+
//initializing countly with params
1949+
Countly.init({
1950+
app_key: countlyGlobal.frontend_app,
1951+
url: countlyGlobal.frontend_server,
1952+
device_id: domain,
1953+
app_version: "<%= countlyVersion %>",
1954+
interval:1000
1955+
});
19571956

1958-
// if domain has changed since the last time it is saved as device id set the new domain as device id and merge it with the old domain
1959-
if (Countly.get_device_id() !== domain) {
1960-
Countly.change_id(domain, true);
1961-
}
1957+
// if domain has changed since the last time it is saved as device id set the new domain as device id and merge it with the old domain
1958+
if (Countly.get_device_id() !== domain) {
1959+
Countly.change_id(domain, true);
1960+
}
1961+
1962+
//track sessions automatically
1963+
Countly.track_sessions();
19621964

1963-
//track sessions automatically
1964-
Countly.track_sessions();
1965+
//track pageviews automatically
1966+
Countly.track_pageview(Countly.getViewName());
19651967

1966-
//track pageviews automatically
1968+
$(window).on('hashchange', function() {
19671969
Countly.track_pageview(Countly.getViewName());
1970+
});
1971+
1972+
//track any clicks to webpages automatically
1973+
Countly.track_clicks();
19681974

1969-
$(window).on('hashchange', function() {
1970-
Countly.track_pageview(Countly.getViewName());
1975+
//track javascript errors
1976+
Countly.track_errors();
1977+
1978+
//display in app messages
1979+
if (Countly.content.enterContentZone) {
1980+
Countly.content.enterContentZone();
1981+
}
1982+
1983+
if (Countly.report_trace && window.performance && window.performance.timing) {
1984+
$(window).on( "load", function(){
1985+
setTimeout(function(){
1986+
var trace = {
1987+
type: "device",
1988+
name: Countly.getViewName(),
1989+
stz: window.performance.timing.navigationStart,
1990+
etz: window.performance.timing.domContentLoadedEventEnd,
1991+
apm_metrics: {}
1992+
};
1993+
if (window.performance.timing.domLoading && window.performance.timing.navigationStart) {
1994+
trace.apm_metrics.first_paint = window.performance.timing.domLoading - window.performance.timing.navigationStart;
1995+
}
1996+
if (window.performance.timing.domContentLoadedEventStart && window.performance.timing.navigationStart) {
1997+
trace.apm_metrics.first_contentful_paint = window.performance.timing.domContentLoadedEventStart - window.performance.timing.navigationStart;
1998+
}
1999+
if (window.performance.timing.domInteractive && window.performance.timing.navigationStart) {
2000+
trace.apm_metrics.dom_interactive = window.performance.timing.domInteractive - window.performance.timing.navigationStart;
2001+
}
2002+
if (window.performance.timing.domContentLoadedEventEnd && window.performance.timing.domContentLoadedEventStart) {
2003+
trace.apm_metrics.dom_content_loaded_event_end = window.performance.timing.domContentLoadedEventEnd - window.performance.timing.domContentLoadedEventStart;
2004+
}
2005+
if (window.performance.timing.loadEventEnd && window.performance.timing.loadEventStart) {
2006+
trace.apm_metrics.load_event_end = window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart;
2007+
}
2008+
if (Object.keys(trace.apm_metrics).length) {
2009+
Countly.report_trace(trace);
2010+
}
2011+
},1);
19712012
});
2013+
}
2014+
2015+
Countly.userData.set("lastServer", window.location.hostname);
2016+
Countly.userData.set("lastVersion", "<%= countlyVersion %>");
2017+
Countly.userData.set("lastEdition", "<%= countlyTypeTrack %>");
2018+
Countly.userData.set("isTrial", <%= countlyTrial %>);
2019+
Countly.userData.set("cpus", <%= cpus %>);
2020+
Countly.userData.push_unique("servers", window.location.hostname);
2021+
Countly.userData.push_unique("versions", "<%= countlyVersion %>");
2022+
Countly.userData.push_unique("editions", "<%= countlyTypeTrack %>");
2023+
Countly.userData.save();
19722024

1973-
//track any clicks to webpages automatically
1974-
Countly.track_clicks();
2025+
<% if (installed) { %>
2026+
Countly.add_event({
2027+
key:"INSTALL"
2028+
});
2029+
<% } %>
2030+
}
19752031

1976-
//track javascript errors
1977-
Countly.track_errors();
2032+
if (countlyGlobal.config.self_tracking) {
2033+
//initializing countly with params
2034+
var Countly2 = Countly.init({
2035+
app_key: countlyGlobal.config.self_tracking,
2036+
url: window.location.origin,
2037+
device_id: countlyGlobal.member.email,
2038+
app_version: "<%= countlyVersion %>",
2039+
interval:1000
2040+
});
19782041

1979-
//display in app messages
1980-
Countly.content.enterContentZone();
1981-
1982-
if (Countly.report_trace && window.performance && window.performance.timing) {
1983-
$(window).on( "load", function(){
1984-
setTimeout(function(){
1985-
var trace = {
1986-
type: "device",
1987-
name: Countly.getViewName(),
1988-
stz: window.performance.timing.navigationStart,
1989-
etz: window.performance.timing.domContentLoadedEventEnd,
1990-
apm_metrics: {}
1991-
};
1992-
if (window.performance.timing.domLoading && window.performance.timing.navigationStart) {
1993-
trace.apm_metrics.first_paint = window.performance.timing.domLoading - window.performance.timing.navigationStart;
1994-
}
1995-
if (window.performance.timing.domContentLoadedEventStart && window.performance.timing.navigationStart) {
1996-
trace.apm_metrics.first_contentful_paint = window.performance.timing.domContentLoadedEventStart - window.performance.timing.navigationStart;
1997-
}
1998-
if (window.performance.timing.domInteractive && window.performance.timing.navigationStart) {
1999-
trace.apm_metrics.dom_interactive = window.performance.timing.domInteractive - window.performance.timing.navigationStart;
2000-
}
2001-
if (window.performance.timing.domContentLoadedEventEnd && window.performance.timing.domContentLoadedEventStart) {
2002-
trace.apm_metrics.dom_content_loaded_event_end = window.performance.timing.domContentLoadedEventEnd - window.performance.timing.domContentLoadedEventStart;
2003-
}
2004-
if (window.performance.timing.loadEventEnd && window.performance.timing.loadEventStart) {
2005-
trace.apm_metrics.load_event_end = window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart;
2006-
}
2007-
if (Object.keys(trace.apm_metrics).length) {
2008-
Countly.report_trace(trace);
2009-
}
2010-
},1);
2011-
});
2012-
}
2042+
//track sessions automatically
2043+
Countly2.track_sessions();
20132044

2014-
Countly.userData.set("lastServer", window.location.hostname);
2015-
Countly.userData.set("lastVersion", "<%= countlyVersion %>");
2016-
Countly.userData.set("lastEdition", "<%= countlyTypeTrack %>");
2017-
Countly.userData.set("isTrial", <%= countlyTrial %>);
2018-
Countly.userData.set("cpus", <%= cpus %>);
2019-
Countly.userData.push_unique("servers", window.location.hostname);
2020-
Countly.userData.push_unique("versions", "<%= countlyVersion %>");
2021-
Countly.userData.push_unique("editions", "<%= countlyTypeTrack %>");
2022-
Countly.userData.save();
2023-
2024-
<% if (installed) { %>
2025-
Countly.add_event({
2026-
key:"INSTALL"
2027-
});
2028-
<% } %>
2045+
//track pageviews automatically
2046+
Countly2.track_pageview(Countly.getViewName());
2047+
2048+
$(window).on('hashchange', function() {
2049+
Countly2.track_pageview(Countly.getViewName());
2050+
});
2051+
2052+
//display in app messages
2053+
if (Countly2.content.enterContentZone) {
2054+
Countly2.content.enterContentZone();
20292055
}
2030-
</script>
2031-
<% } %>
2056+
2057+
Countly2.user_details({
2058+
"name": countlyGlobal.member.full_name || "",
2059+
"username": countlyGlobal.member.username || "",
2060+
"email": countlyGlobal.member.email
2061+
});
2062+
}
2063+
</script>
20322064
<% } %>
20332065
<script type='text/javascript'>
20342066
app.recordEvent = function (event) {

plugins/plugins/frontend/public/javascripts/countly.views.js

+11
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,17 @@
11701170
}
11711171
});
11721172

1173+
var appList = [{value: "", label: jQuery.i18n.map["configs.frontend-self_tracking.none"]}];
1174+
for (var a in countlyGlobal.apps) {
1175+
appList.push({value: countlyGlobal.apps[a].key, label: countlyGlobal.apps[a].name});
1176+
}
1177+
1178+
app.configurationsView.registerInput("frontend.self_tracking", {
1179+
input: "el-select",
1180+
attrs: {},
1181+
list: appList
1182+
});
1183+
11731184
app.configurationsView.registerStructure("api", {
11741185
description: "configs.api.description",
11751186
groups: [

plugins/plugins/frontend/public/localization/plugins.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ configs.no-theme = Default Theme
6464
configs.frontend-code = Show Code Generator for SDK integration
6565
configs.frontend-offline_mode = Offline mode
6666
configs.frontend-countly_tracking = Countly
67+
configs.frontend-self_tracking = Self tracking using Countly
68+
configs.frontend-self_tracking.none = -- Not tracked --
6769
configs.security-login_tries = Allowed login attempts
6870
configs.security-login_wait = Incorrect login block time increment
6971
configs.security-dashboard_additional_headers = Additional Dashboard HTTP Response headers
@@ -175,7 +177,7 @@ configs.help.frontend-countly_tracking = When enabled, Countly will be activated
175177
configs.help.frontend-production = Initial load of dashboard should be faster, due to smaller files and smaller file amount, but when developing a plugin, you need to regenerate them to see changes
176178
configs.help.frontend-theme = Selected theme will be available server-wide, for all apps and users
177179
configs.help.frontend-session_timeout = User will be forced to logout after session timeout (in minutes) of inactivity. If you want to disable force logout, set to 0.
178-
configs.help.frontend-google_maps_api_key = Google requires an API key for Geocharts visualization used in views such as Overview and Analytics > Countries. Provide your API key to use this visualization without any limitations. <a href="https://developers.google.com/maps/documentation/javascript/get-api-key">Learn how to get your API key.</a>
180+
configs.help.frontend-self_tracking = If you want to track usage of this server and users that are using the dashboard, select an app where to collect this data. Make sure to create a new app specifically for this purpose, or else you would merge collected data with existing. Data will only be stored on this server and will not be sent anywhere else. By selecting an app, you will enabling tracking of this server and it will count towards your datapoint quota. The scale of datapoints will depend on your user count and often usage of this dashboard.
179181
configs.help.security-login_tries = Account will be blocked for some time after provided number of incorrect login attempts. See below for time increments.
180182
configs.help.security-login_wait = Incremental period of time account is blocked after provided number of incorrect login attempts (in seconds)
181183
configs.help.security-password_rotation = Amount of previous passwords user should not be able to reuse

0 commit comments

Comments
 (0)