Skip to content

v3.0.0

Compare
Choose a tag to compare
@Blaumaus Blaumaus released this 24 May 22:14
· 3344 commits to main since this release

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