Skip to content

Releases: Swetrix/swetrix

v3.3.0

08 Nov 18:54
Compare
Choose a tag to compare

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. The Allowed 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 at true.

🙂 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 to true
  • 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:

  1. Go to the selfhosting repository and run the docker compose down command to switch off Swetrix.
  2. Back up your docker-compose.yml settings somewhere else, as you will need to reuse them later on. Run git pull to download our latest config (if this command does not work, you can run git checkout -- . first, but make sure you have saved your config file, as this will undo your changes).
  3. 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.
  4. 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.
Screenshot_2024-11-06_at_20_19_59

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

30 Aug 23:10
Compare
Choose a tag to compare

What changed:

🔧 Fixes

  • Removed console.log's in some functions, which were accidentally added in the previous release (0734205)

v3.2.2

30 Aug 22:57
054c633
Compare
Choose a tag to compare

What changed:

This release has no changes and has been released due to Docker release issues with the v3.2.1 version.

v3.2.1

30 Aug 22:44
Compare
Choose a tag to compare

What changed:

🔧 Fixes

  • Fixed an issue that caused most analytics data not to be saved in the Clickhouse database. (d46cc2b)
  • Error tracking: Pass request headers into the getGeoDetails function for proper geolocation tracking. (a02e003)

v3.2.0

11 Aug 14:25
Compare
Choose a tag to compare

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 to true 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

  1. For swetrix image, update the following:
  • Change swetrix/swetrix-fe:v3.1.0 to swetrix/swetrix-fe:v3.2.0.
  1. For swetrix-api image, update the following:
  • Change swetrix/swetrix-api:v3.1.0 to swetrix/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

10 Jun 21:08
7d8eaff
Compare
Choose a tag to compare

What changed:

🙂 Minor changes:

  • Added arm64 architecture support (#237)

v3.0.1

09 Jun 18:59
Compare
Choose a tag to compare

What changed:

🔧 Fixes:

  • Fixed a bug when custom events did not appear in the funnel steps list.

v3.0.0

24 May 22:14
Compare
Choose a tag to compare

⚡️ 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

  1. For swetrix image, update the following:
  • Change swetrix/swetrix-fe:v2.1.0 to swetrix/swetrix-fe:v3.0.0.
  • Change 80:80 ports to 80:3000. If you expose your swetrix image on a custom port, like 5678:80, you need to change it to 5678:3000.
  • Remove the REACT_APP_AIAPI_URL environment variable.
  • Rename REACT_APP_SELFHOSTED environment variable to SELFHOSTED.
  1. For swetrix-api image, update the following:
  • Change swetrix/swetrix-api:v2.1.2 to swetrix/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

  1. Update Redis image to redis:7.2-alpine
  2. 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

22 May 21:19
06587de
Compare
Choose a tag to compare
v3.0.0-rc.1 Pre-release
Pre-release

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

New Contributors

Full Changelog: v2.0.3...v3.0.0-rc.1

v2.1.2

11 Oct 22:07
Compare
Choose a tag to compare

Changelog:

  • [fix] Fixed user preference update logic.
  • [improvement] Added error logging.