Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

remove weekly salt; remove salt selector from project settings

Blue Mouse324944d9bad1
diff --git a/backend/apps/cloud/src/project/entity/project.entity.ts b/backend/apps/cloud/src/project/entity/project.entity.ts
index 142710366..58a8259f9 100644
--- a/backend/apps/cloud/src/project/entity/project.entity.ts
+++ b/backend/apps/cloud/src/project/entity/project.entity.ts
@@ -24,12 +24,6 @@ export enum BotsProtectionLevel {
BASIC = 'basic',
}
-export enum SaltRotation {
- DAILY = 'daily', // Default - current behavior, for DAU tracking
- WEEKLY = 'weekly', // For WAU (Weekly Active Users) tracking
- MONTHLY = 'monthly', // For MAU (Monthly Active Users) tracking
-}
-
// In case of modifying some properties here add them to the GDPR data export email template
@Entity()
export class Project {
@@ -96,14 +90,6 @@ export class Project {
})
botsProtectionLevel: BotsProtectionLevel
- @ApiProperty()
- @Column({
- type: 'enum',
- enum: SaltRotation,
- default: SaltRotation.DAILY,
- })
- saltRotation: SaltRotation
-
@ApiProperty({ type: () => User })
@ManyToOne(() => User, user => user.projects)
admin: User
diff --git a/backend/apps/community/src/common/utils.ts b/backend/apps/community/src/common/utils.ts
index 06fbfb1a5..d9a34ba2f 100644
--- a/backend/apps/community/src/common/utils.ts
+++ b/backend/apps/community/src/common/utils.ts
@@ -122,7 +122,6 @@ const ALLOWED_KEYS = [
'isPasswordProtected',
'passwordHash',
'botsProtectionLevel',
- 'saltRotation',
]
const CLICKHOUSE_PROJECT_UPDATABLE_KEYS = [...ALLOWED_KEYS, 'adminId']
diff --git a/backend/apps/community/src/project/entity/project.entity.ts b/backend/apps/community/src/project/entity/project.entity.ts
index d431a3862..6116cd3d1 100644
--- a/backend/apps/community/src/project/entity/project.entity.ts
+++ b/backend/apps/community/src/project/entity/project.entity.ts
@@ -3,12 +3,6 @@ export enum BotsProtectionLevel {
BASIC = 'basic',
}
-export enum SaltRotation {
- DAILY = 'daily', // Default - current behavior, for DAU tracking
- WEEKLY = 'weekly', // For WAU (Weekly Active Users) tracking
- MONTHLY = 'monthly', // For MAU (Monthly Active Users) tracking
-}
-
export class Project {
id: string
name: string
@@ -19,7 +13,6 @@ export class Project {
public: boolean
isPasswordProtected: boolean
botsProtectionLevel: BotsProtectionLevel
- saltRotation: SaltRotation
passwordHash?: string
created: Date
adminId: string | null
diff --git a/backend/migrations/clickhouse/initialise_selfhosted.js b/backend/migrations/clickhouse/initialise_selfhosted.js
index 0e8aa9eab..f53922bb1 100644
--- a/backend/migrations/clickhouse/initialise_selfhosted.js
+++ b/backend/migrations/clickhouse/initialise_selfhosted.js
@@ -29,7 +29,6 @@ const CLICKHOUSE_INIT_QUERIES = [
public Int8,
isPasswordProtected Int8,
botsProtectionLevel String DEFAULT 'basic',
- saltRotation String DEFAULT 'daily',
passwordHash Nullable(String),
adminId Nullable(String),
created DateTime
diff --git a/backend/migrations/clickhouse/selfhosted_2025_12_05_remove_salt_rotation.js b/backend/migrations/clickhouse/selfhosted_2025_12_05_remove_salt_rotation.js
new file mode 100644
index 000000000..5d2be7a7b
--- /dev/null
+++ b/backend/migrations/clickhouse/selfhosted_2025_12_05_remove_salt_rotation.js
@@ -0,0 +1,9 @@
+// This migration removes the saltRotation column from the project table for self-hosted instances
+// Salt rotation is now handled globally and no longer configurable per-project
+const { queriesRunner, dbName } = require('./setup')
+
+const queries = [
+ `ALTER TABLE ${dbName}.project DROP COLUMN IF EXISTS saltRotation;`,
+]
+
+queriesRunner(queries)
diff --git a/backend/migrations/mysql/2025_12_05_remove_salt_rotation.sql b/backend/migrations/mysql/2025_12_05_remove_salt_rotation.sql
new file mode 100644
index 000000000..0406ce427
--- /dev/null
+++ b/backend/migrations/mysql/2025_12_05_remove_salt_rotation.sql
@@ -0,0 +1,3 @@
+-- Remove saltRotation column from project table
+-- This column is no longer needed as salt rotation is now handled globally
+ALTER TABLE `project` DROP COLUMN `saltRotation`;
diff --git a/web/app/lib/models/Project.ts b/web/app/lib/models/Project.ts
index 7cf1dcae0..b3ad508e0 100644
--- a/web/app/lib/models/Project.ts
+++ b/web/app/lib/models/Project.ts
@@ -189,7 +189,6 @@ export interface Project {
isDataExists: boolean
isErrorDataExists: boolean
botsProtectionLevel: 'off' | 'basic'
- saltRotation: 'daily' | 'weekly' | 'monthly'
role?: Role
gscPropertyUri?: string | null
}
diff --git a/web/app/pages/Project/Settings/ProjectSettings.tsx b/web/app/pages/Project/Settings/ProjectSettings.tsx
index a0bc3e90d..ca6431274 100644
--- a/web/app/pages/Project/Settings/ProjectSettings.tsx
+++ b/web/app/pages/Project/Settings/ProjectSettings.tsx
@@ -291,7 +291,6 @@ const ProjectSettings = () => {
ipBlacklist: null,
countryBlacklist: [],
botsProtectionLevel: 'basic',
- saltRotation: 'daily',
gscPropertyUri: null,
})
const [validated, setValidated] = useState(false)
@@ -378,23 +377,6 @@ const ProjectSettings = () => {
] as const
}, [t])
- const saltRotationOptions = useMemo(() => {
- return [
- {
- name: 'daily',
- title: t('project.settings.saltRotation.options.daily'),
- },
- {
- name: 'weekly',
- title: t('project.settings.saltRotation.options.weekly'),
- },
- {
- name: 'monthly',
- title: t('project.settings.saltRotation.options.monthly'),
- },
- ] as const
- }, [t])
-
const organisations = useMemo(
() => [
{
@@ -797,13 +779,6 @@ const ProjectSettings = () => {
beenSubmitted={beenSubmitted}
handleInput={handleInput}
sharableLink={sharableLink}
- saltRotationOptions={saltRotationOptions}
- setSaltRotation={(name) =>
- setForm((prevForm) => ({
- ...prevForm,
- saltRotation: name as any,
- }))
- }
/>
) : null}
diff --git a/web/app/pages/Project/Settings/tabs/General.tsx b/web/app/pages/Project/Settings/tabs/General.tsx
index d7ba25100..915f2d426 100644
--- a/web/app/pages/Project/Settings/tabs/General.tsx
+++ b/web/app/pages/Project/Settings/tabs/General.tsx
@@ -2,13 +2,11 @@ import React from 'react'
import { useTranslation } from 'react-i18next'
import Input from '~/ui/Input'
-import Select from '~/ui/Select'
interface GeneralProps {
form: {
name?: string
id?: string
- saltRotation?: string
}
errors: {
name?: string
@@ -16,19 +14,9 @@ interface GeneralProps {
beenSubmitted: boolean
handleInput: (e: React.ChangeEvent<HTMLInputElement>) => void
sharableLink: string
- saltRotationOptions: readonly { name: string; title: string }[]
- setSaltRotation: (name: string) => void
}
-const General = ({
- form,
- errors,
- beenSubmitted,
- handleInput,
- sharableLink,
- saltRotationOptions,
- setSaltRotation,
-}: GeneralProps) => {
+const General = ({ form, errors, beenSubmitted, handleInput, sharableLink }: GeneralProps) => {
const { t } = useTranslation('common')
return (
@@ -62,20 +50,6 @@ const General = ({
error={null}
disabled
/>
- <div className='mt-4'>
- <Select
- id='saltRotation'
- label={t('project.settings.saltRotation.title')}
- hint={t('project.settings.saltRotation.hint')}
- // @ts-expect-error
- items={saltRotationOptions}
- title={saltRotationOptions.find((predicate) => predicate.name === form.saltRotation)?.title || ''}
- labelExtractor={(item: any) => item.title}
- onSelect={(item) => setSaltRotation(item.name)}
- capitalise
- selectedItem={saltRotationOptions.find((predicate) => predicate.name === form.saltRotation)}
- />
- </div>
</>
)
}
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index 6425837c8..2a802e2e2 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -1209,15 +1209,6 @@
"basic": "Basic: we detect bots based on their user agent (Googlebot, Bingbot, curl, etc.)"
}
},
- "saltRotation": {
- "title": "Unique visitor tracking period",
- "hint": "Controls how long a visitor is recognized as the same unique visitor. Daily is best for DAU (Daily Active Users), weekly for WAU, and monthly for MAU (Monthly Active Users) tracking.",
- "options": {
- "daily": "Daily (default): visitors reset at midnight UTC",
- "weekly": "Weekly: visitors reset on Monday at midnight UTC",
- "monthly": "Monthly: visitors reset on the 1st of each month"
- }
- },
"verify": "Please, verify your email address first",
"updated": "The project's settings were updated",
"created": "The project has been created",