Added new setting to toggle tracking of member sources (#15705)

refs https://github.com/TryGhost/Team/issues/2168

- the new setting allows site owners to control if they want to track
the sources for new member signups and subscriptions
- its switched on by default, but can be toggled off from new analytics
settings page
This commit is contained in:
Rishabh Garg 2022-10-27 17:24:46 +05:30 committed by GitHub
parent da559e5a7f
commit cca0f7d7dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 2 deletions

View File

@ -48,6 +48,7 @@ const EDITABLE_SETTINGS = [
'mailgun_base_url',
'email_track_opens',
'email_track_clicks',
'members_track_sources',
'amp',
'amp_gtag_id',
'slack_url',

View File

@ -0,0 +1,8 @@
const {addSetting} = require('../../utils');
module.exports = addSetting({
key: 'members_track_sources',
value: 'true',
type: 'boolean',
group: 'members'
});

View File

@ -295,6 +295,14 @@
"members_yearly_price_id": {
"defaultValue": null,
"type": "string"
},
"members_track_sources": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [["true", "false"]]
},
"type": "boolean"
}
},
"portal": {

View File

@ -234,7 +234,7 @@ describe('Exporter', function () {
// NOTE: if default settings changed either modify the settings keys blocklist or increase allowedKeysLength
// This is a reminder to think about the importer/exporter scenarios ;)
const allowedKeysLength = 71;
const allowedKeysLength = 72;
totalKeysLength.should.eql(SETTING_KEYS_BLOCKLIST.length + allowedKeysLength);
});
});

View File

@ -37,7 +37,7 @@ describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = 'bb48c3c754f74f02a6ce020af6b0e6a7';
const currentFixturesHash = 'dcb7ba7c66b4b98d6c26a722985e756a';
const currentSettingsHash = '2978a5684a2d5fcf089f61f5d368a0c0';
const currentSettingsHash = 'aa0014a3b9fd9e69a1402fb1b5d4210b';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
// If this test is failing, then it is likely a change has been made that requires a DB version bump,