Releases: Swetrix/swetrix
v3.3.0
Warning
This release contains some breaking changes that require migrations, so please read these instructions carefully.
What changed:
🔥 Major updates
- Add support for UTM Term & UTM Content metrics
- Add browser and OS version metrics
- Swetrix is now more memory efficient with lots of optimisations done for our Clickhouse and Redis usage
- Added support for region and city geolocation tracking. Swetrix now ships with a DB-IP geolocation database, you can also use your own .mmdb databases by setting a new
IP_GEOLOCATION_DB_PATH
variable - Clickhouse logs are no longer removed by Swetrix and instead we strongly recommend that you tune Clickhouse with its config files. We include several configs for this, so read on to know how to enable them
- Removed
API_ORIGINS
environment variable. TheAllowed origins
setting on the project settings page should be used instead - Removed
SELFHOSTED
environment variable - Added
IS_PRIMARY_NODE
environment variable. For 99% of use cases there's no need to set up multiple API nodes, one node is capable of handling lots of traffic, so it's recommended to keep it attrue
.
🙂 Minor changes
- Redesigned notifications
- Displaying custom events metadata in session overview
- Added sorting for custom events and page-views metadata table
- Replaced blake3 session hashing with xxHash for better performance
- Removed always shown scrollbars on overflowing rows for dashboard panels
- Now you can go to user session by clicking on rows inside Live visitors dropdown
- Disable comparisons for
This hour
timebucket due to it's buggy behaviour
🔧 Fixes
- Session filters do not work properly when refreshing the page
- Fixed an issue when sometimes you could see
TypeError: Cannot destructure property 'index' of 's[0]' as it is null
errors thrown in dashboard - Session chart is not working when account timezone is not set to UTC
- User flow chart did not work properly and did not display accurate data
- Errors tracked with Swetrix were displayed in dashboard with a delay for users with timezone not set at UTC
- Geolocation tracking was not working for users who had
CLOUDFLARE_PROXY_ENABLED
variable set totrue
- Sharable link on project settings was set to swetrix.com
Upgrading to Swetrix v3.3.0 (from v3.2.x)
Important
You will need to perform a database migration. Please make sure you read these instructions through to the end to make sure you've updated properly and to avoid losing any data.
1. Added .env
file; docker-compose.yml
is now compose.yaml
We've taken a lot of feedback from the previous release into account and tried to make the self-hosted version of Swetrix easy to set up, upgrade and maintain. So some changes have been made to achieve this.
Before upgrading, you should back up your docker-compose.yml
settings, as you'll need them later.
To upgrade your configuration files, do the following:
- Go to the selfhosting repository and run the
docker compose down
command to switch off Swetrix. - Back up your
docker-compose.yml
settings somewhere else, as you will need to reuse them later on. Rungit pull
to download our latest config (if this command does not work, you can rungit checkout -- .
first, but make sure you have saved your config file, as this will undo your changes). - After you do a
git pull
, run the./configure.sh
script. It will prompt you to enter environment variables one at a time and will generate an.env
file at the end. You can edit this.env
file manually as well if required. - Run the
docker compose up -d
command. This will pull the latest Swetrix and Clickhouse releases. If you open your dashboard now, it will not work properly. This is expected as you still need to do a data migration to synchronise the new code with the database tables.
The new compose.yaml
configuration also comes with several different Clickhouse configs from us to make Swetrix work more efficiently and faster. You can also create your own configs and add them to the compose file.
2. Run database migration scripts
Warning
Please make sure you always back up your data! Especially before migrating, to prevent data loss if something goes wrong.
In order to upgrade to Swetrix v3.3.0, you will need to run database migrations scripts. We assume that you've already followed the instructions above, so your compose.yaml
file should already be set to the latest Swetrix versions and they are already installed on your machine.
To perform the migrations, you need to run the following commands in your selfhosting
folder:
docker compose exec swetrix-api node migrations/clickhouse/2024_09_10.js
docker compose exec swetrix-api node migrations/clickhouse/2024_10_15.js
docker compose exec swetrix-api node migrations/clickhouse/2024_10_20.js
docker compose exec swetrix-api node migrations/clickhouse/2024_10_25.js
docker compose exec swetrix-api node migrations/clickhouse/2024_10_26.js
docker compose exec swetrix-api node migrations/clickhouse/2024_10_27.js
docker compose exec swetrix-api node migrations/clickhouse/2024_10_28.js
docker compose exec swetrix-api node migrations/clickhouse/selfhosted_2024_10_17.js
It will perform the migrations one at a time. If you don't see any Query ERROR messages written to your console, this indicates that the migrations went well and Swetrix v3.3.0 is ready to use. You should not run this script more than once.
After performing the migrations, you can run docker compose restart
and Swetrix should be good to go!
🎉 That's it, enjoy selfhosting Swetrix! Let us know if you find any bugs or have any feedback for us and join our Discord.
Our work would not be possible without your support, and we hope you will love this release!
v3.2.3
v3.2.2
v3.2.1
v3.2.0
What changed:
🔥 Major updates
- Added support for project views and e-commerce integration (treating custom event metadata as numbers). (#238, #248, #251)
- Added pageview tags (metadata) support (#239)
🙂 Minor changes
- Migrated from
clickhouse
to@clickhouse/client
library. This change allows us to implement near instant analytics data collection (before there was an up to 1 minute delay). (#246) - Added
DEBUG_MODE
option, which when set totrue
will print more logs from Clickhouse.
🔧 Fixes
- Projects endpoint was not accessible as
v1/project
. - API keys did not work on
v1/project
endpoint.
Upgrading to Swetrix v3.2.0 (from v3.1.0)
Important
You will need to perform a database migration. Please make sure you read these instructions through to the end to make sure you've updated properly and to avoid losing any data.
Warning
Please make sure you always back up your data! Especially before migrating, to prevent data loss if something goes wrong.
In order to upgrade to Swetrix v3.2.0, you will need to perform the following actions:
1. Shut down your Swetrix docker container
In the self-hosting folder where your docker-compose.yml
file is located, run the docker compose down
command.
2. Update your docker-compose.yml
file
- For
swetrix
image, update the following:
- Change
swetrix/swetrix-fe:v3.1.0
toswetrix/swetrix-fe:v3.2.0
.
- For
swetrix-api
image, update the following:
- Change
swetrix/swetrix-api:v3.1.0
toswetrix/swetrix-api:v3.2.0
.
3. Start up your docker container
Run the docker compose up -d
command. This will pull up the Swetrix v3.2.0 release.
If you open your dashboard now, it will not work properly. This is expected as you still need to do a data migration to synchronise the new code with the database tables.
4. Run data migrations
In your selfhosting
folder, you will need to run the following commands:
docker compose exec swetrix-api node migrations/clickhouse/2024_06_22.js
docker compose exec swetrix-api node migrations/clickhouse/selfhosted_2024_08_10.js
It will perform the migrations one at a time. If you don't see any Query ERROR messages written to your console, this indicates that the migrations went well and Swetrix v3.2.0 is ready to use.
You should not run these scripts more than once.
5. Enjoy our latest Swetrix release :)
Let us know if you find any bugs or have any feedback for us. Our work would not be possible without your support, and we hope you will love this release!
Full Changelog: v3.1.0...v3.2.0
v3.1.0
v3.0.1
v3.0.0
⚡️ Introducing Swetrix v3 - an even faster and more capable web analytics
If you're using Swetrix v2, please read these notes to the end as they contain important information on how to upgrade correctly.
What changed:
🔥 Major updates
- Added session analytics: you can now see which pages / custom events were tracked within a session, as well as some details about them
- Added support for marketing funnels
- Added client-side error tracking
- Added metadata feature for custom events
- Added more metrics for performance monitoring: you can now see load time distribution over different quantiles, as well as apply different aggregation functions to your data
- Added API key support
🙂 Minor changes:
- Project ID now generated on the backend for new sites
- Removed validate-ip-node library in favour of built-in Node.js net module
- Project "Allowed origins" setting now supports wildcards
- You can now partially clear analytics data with filters
- Added support for more detailed filters; you can now apply multiple filters to the same data column
- Added new time buckets for aggregated reporting: "All time" and "This hour
- Added site search functionality to the dashboard page
- Added support for cumulative mode for charts
- Migrated frontend frow React to Remix to enable server-side rendering and improve performance
- Added support for embedded dashboards
- Updated analytics dashboard design and other UI / UX improvements throughout the application
- Added support for dashboard hotkeys
- Updated API dependencies
- Updated Clickhouse & Redis versions
🔧 Fixes:
- Fixed an issue where users could not disable the "Show live visitors in page title" feature.
- Fixed a possible issue where a non-existent tab could be opened in the dashboard
Upgrading to Swetrix v3
Important
You will need to perform a database migration. Please make sure you read these instructions through to the end to make sure you've updated properly and to avoid losing any data.
We'll assume that you're using the docker-compose.yml
file from our selfhosting repository, as the following notes are based on it.
Warning
Please make sure you always back up your data! Especially before migrating, to prevent data loss if something goes wrong.
In order to upgrade to Swetrix v3, you will need to perform the following actions:
1. Shut down your Swetrix docker container
In the self-hosting folder where your docker-compose.yml
file is located, run the docker compose down
command.
2. Update your docker-compose.yml
file
- For
swetrix
image, update the following:
- Change
swetrix/swetrix-fe:v2.1.0
toswetrix/swetrix-fe:v3.0.0
. - Change
80:80
ports to80:3000
. If you expose your swetrix image on a custom port, like5678:80
, you need to change it to5678:3000
. - Remove the
REACT_APP_AIAPI_URL
environment variable. - Rename
REACT_APP_SELFHOSTED
environment variable toSELFHOSTED
.
- For
swetrix-api
image, update the following:
- Change
swetrix/swetrix-api:v2.1.2
toswetrix/swetrix-api:v3.0.0
. - Add new environment variables:
API_KEY=
CLOUDFLARE_PROXY_ENABLED=false
Don't set any value to the API_KEY
variable if you don't need to access your data directly via the API. You can read more about these new variables on our documentation page
- Update Redis image to
redis:7.2-alpine
- Update Clickhouse image to
clickhouse/clickhouse-server:23.8-alpine
3. Start up your docker container
Run the docker compose up -d
command. This will pull up the Swetrix v3 release and automatically perform some migrations to create new tables.
If you open your dashboard now, it will not work properly. This is expected as you still need to do a data migration to synchronise the new code with the database tables.
4. Run data migrations
In your selfhosting
folder, you will need to run the following command:
docker compose exec swetrix-api node migrations/clickhouse/selfhosted_v2_to_v3.js
It will perform the migrations one at a time. If you don't see any Query ERROR messages written to your console, this indicates that the migrations went well and Swetrix v3 is ready to use.
You should not run this script more than once.
5. Enjoy our latest Swetrix release :)
Let us know if you find any bugs or have any feedback for us. Our work would not be possible without your support, and we hope you will love this release!
v3.0.0-rc.1
This is a test pre-release for the upcoming v3 selfhosted version. A detailed migration guide will be provided with a regular release.
What's Changed
- (improvement) Server-side Project ID generation by @Blaumaus in #153
- using built-in nodejs net module instead of validate-ip-node by @Blaumaus in #154
- (feature) Social link previews by @Blaumaus in #156
- (imporvments) logout form all devices by @kruzhambus in #155
- (improvments) recieve login checkbox by @kruzhambus in #157
- Add wildcard support to the 'allowed origins' setting by @kruzhambus in #158
- Delete data via filters by @kruzhambus in #159
- (feature) Cities & regions by @Blaumaus in #160
- (improvement) Advanced filters + standardise filters API resonse by @Blaumaus in #161
- (fix) Custom Event filtering by @Blaumaus in #164
- (improvement) Missing Docker service for the development environment by @yevheniikulisidi in #165
- (improvement) Pro-rata subscription upgrades by @Blaumaus in #166
- hot fix and remove funnels by @kruzhambus in #170
- some update by @kruzhambus in #171
- (fix) Preventing a Telegram overlimit error by @yevheniikulisidi in #167
- (feature) Sentry error handling service by @yevheniikulisidi in #173
- (improvement) Ignoring errors for Sentry by @yevheniikulisidi in #174
- Add 'All time' and 'This hour' timebuckets by @kruzhambus in #172
- fast fix by @kruzhambus in #175
- fast fix all period by @kruzhambus in #176
- (feature) 'minute' time bucket by @Blaumaus in #177
- (improvement) Minute TB by @Blaumaus in #178
- (fix) Error with invalid Google token by @yevheniikulisidi in #179
- (improvement) Drop Cloudflare by @Blaumaus in #168
- (fix) Preventing an error due to lack of validation by @yevheniikulisidi in #183
- (improvement) Preparing for the next selfhosted release by @Blaumaus in #182
- fix get shared project by @kruzhambus in #180
- (improvement) Fixed integration with Telegram by @yevheniikulisidi in #184
- (feature) Anonymous pages by @Blaumaus in #186
- (fix) Updated 'update current user' route by @yevheniikulisidi in #185
- (feature) Account deletion feedback by @Blaumaus in #187
- (improvement) Reset email report frequency for inactive users by @Blaumaus in #188
- (feature) Alerts for custom events by @kruzhambus in #181
- (improvement) Authorisation by @Blaumaus in #189
- (improvement) : Minor enhancements in CONTRIBUTING.MD file by @Pranavvks in #191
- (feature) Referral program by @Blaumaus in #190
- (improvement) Added new tiers & increased alerts and projects limit by @Blaumaus in #192
- (feature) project search by @kruzhambus in #193
- (improvement) Move maxprojects to user table by @Blaumaus in #194
- (feature) Support for creating / updating / deleting projects via api key by @Blaumaus in #195
- (feature) Custom events metadata by @Blaumaus in #196
- (feature) Cumulative mode by @Blaumaus in #197
- (feature) Funnels by @Blaumaus in #198
- (feature) Predefined funnels by @Blaumaus in #199
- (feature) Extension marketplace comments & replies by @kruzhambus in #163
- (improvement) Enhanced
GET /log/birdseye
by @Blaumaus in #202 - (feature) Opengraph image generator by @Blaumaus in #205
- (improvement) Updated dependencies by @Blaumaus in #206
- (feature) Session overview / Clickstream by @Blaumaus in #207
- add ApiBearerAuth decorator for swagger auth by @pro1code1hack in #208
- remove styles from emails and update content by @pro1code1hack in #209
- Set redis
options.family
to0
by @brody192 in #210 - (improvement) Plan limitation rework by @Blaumaus in #212
- (improvement) Return a flag to indicate if there is data for a specific project by @Blaumaus in #216
- (fix) Data exists & is locked flags for shared projects by @Blaumaus in #219
- (improvement) Shared projects admin rights by @Blaumaus in #220
- (improvement) Performance metrics by @Blaumaus in #222
- (improvement) Performance birdseye measures support by @Blaumaus in #223
- (improvement) Automatic database synchronization by @yevheniikulisidi in #225
- (improvement) Migrate from postmark to AWS SES by @Blaumaus in #229
- (improvement) Architecture by @Blaumaus in #228
- (feature/healthchecks) Health checks by @yevheniikulisidi in #231
- (feature) Error tracking by @Blaumaus in #224
- (improvement) Timezone support for sessions by @Blaumaus in #233
- (fix) Errors API timezones support by @Blaumaus in #234
- Phase out automatic CAPTCHA by @Blaumaus in #236
- (improvement) Preparing for a new selfhosted release by @Blaumaus in #235
New Contributors
- @Pranavvks made their first contribution in #191
- @brody192 made their first contribution in #210
Full Changelog: v2.0.3...v3.0.0-rc.1