In a previous post, we explained why you should switch from Google Analytics to Matomo for your audience measurement. Some of our customers have decided to take this step, and Clever Cloud has helped them get to grips with the solution. Based on this experience, find out in this article how to maximize the use of our Matomo addon on Clever Cloud.
Selecting the optimal instance size
As soon as the Matomo addon is created, Clever Cloud deploys three optimized instances (a PHP runtime, a MySQL addon and a Redis addon). Initially, they are sized to the minimum server requirements in order to evolve according to your needs, thus ensuring cost optimization. If you need to make adjustments (for example, if you start to experience errors or slowdowns when launching some processes), our integrated Grafana is your best ally for monitoring your metrics and adjusting your resources accordingly.
Easy access to your metrics
Thanks to the intuitive dashboard for each application, you’re provided with a clear view of it all. We’ve recently integrated a metrics tile into this dashboard, allowing you to track RAM and CPU consumption in real time from the console.
For a more in-depth analysis, a simple click on the Grafana logo from the tile gives you access to all your application’s metrics.
In addition, Matomo’s PHP instance logs are always there to provide you with additional information.
All about auto-scalability
Self-scalability on Clever Cloud is a major advantage, giving you peace of mind and flexible billing. With Matomo, this feature guarantees a smooth experience even in times of high demand. Keep in mind certain specifics, such as the occasional need for certain extensions, and you’ll you make the most of this feature.
Perks from enabling auto-scalability on the PHP instance
With auto-scalability, you can use Matomo smoothly and adaptively, even during peak periods! Benefit from powerful on-demand resources, while paying only for the consumption/second. Once you’ve completed your intensive tasks, your instance returns to an optimal size, guaranteeing efficiency and savings. So there’s no need to reserve a large infrastructure to meet occasional needs.
When to disable auto-scalability?
Clever Cloud provides a service that can be adapted to your needs, with the option of limiting or completely disabling instance auto-scalability. In some cases, it may be advisable to deactivate it from time to time.
As Matomo is a managed service, some configuration options are unalterable to guarantee optimal operation and performance. As part of Matomo’s continuous improvement, we have integrated the Google Analytics data import extension in response to common customer requests. This extension, generally used for a one-off migration from Google Analytics to Matomo, is deactivated by default.
If you activate the extension and start importing data, and your application scales, your instance reboots and redeploys the application… with the default configurations. Restarting will therefore disable this extension and kill the import process at the same time. If you decide to use an extension that appears as disabled by default in our Matomo, we recommend the following procedure:
- Disable auto-scalability for your Matomo PHP instance
- Increase the instance size until the process is complete
- Restart instance
- Once the instance has been redeployed, activate the extension in Matomo
Now you’re ready to use the extension, which will remain active until the next server restart.
Matomo, with its MySQL addon, is designed to grow with you. While the database is created with sufficient capacity at start-up, Matomo will quickly exploit its potential. To avoid surprises, why not set up Grafana alerts to monitor memory levels?
Creating alerts
Among its many features, Grafana lets you create alerts on the metrics of your choice. You’ll find a tutorial here to show you how to create your alerts from Grafana to Slack, which you can also apply to other contact points like Discord, Teams, etc.
We recommend that you leave around 20% disk space available, as the MySQL instance will need disk to migrate.
Migrating the database
Although scalability has its peculiarities for databases, Clever Cloud provides a smooth and intuitive manual solution. When you receive the alert, a simple connection to the Console on your MySQL addon dashboard will enable you to launch our one-click migration tool. This operation can take from a few seconds to a few minutes, depending on the size of your database.
💡 Tip: Include a direct link to the migration tab in your Grafana alert message. This will give you instant access to the migration tool, making the process even easier.
Leveraging Matomo and Clever Cloud
Although a managed service is pre-configured, you have Matomo administrator status and can use it as such. Here are just a few examples of what you can do with Matomo and Clever Cloud.
Adding new Matomo users
All our managed services use Clever Cloud SSO, enabling you to access deployed addons from your platform credentials. Perhaps you’d like to add users to Matomo without giving them access to the platform.
Matomo lets you add users with different levels of permissions to the application. You can invite them by email directly from the Matomo interface. Users invited by this method will not have access to Matomo’s system settings or extensions, unlike Clever Cloud users.
Elevating permission levels
If you have added a user from the Matomo interface, but now wish to add them to your Clever Cloud organization with the same email address, access to Matomo will be denied for security reasons, since this user already exists in the database.
To avoid duplication, simply delete the Matomo user from your database.
- Launch your MySQL addon’s PHPMyAdmin interface
- Click on your database name (not schema)
- Search by keyword
user
and choose the tablematomo_user
- Delete the user you wish to add to the Clever Cloud organization
Now you can invite the user to your organization with his email address, giving him administration rights on the instance.
Measure the audience of any application
On Clever Cloud, you can separate your collaborative environments by creating organizations to which you invite members. Organizations remain isolated, ensuring that no member has uninvited access to an organization’s applications and addons.
Matomo makes it possible to track apps to which a simple script has been added to the head. So, even if an application is deployed within a different organization, Matomo offers a unified and complete view of its audience tracking as soon as the application contains this script.
Optimizing role separation
You can set up a dedicated organization for the Matomo administrator of your company or association. From this organization, the administrator can monitor the audience of applications hosted in other organizations, even if these are inaccessible to him/her.
To implement this configuration, the administrator simply provides the appropriate script to be integrated into the head tag of each application. Once integrated, the tracking data will be visible in Matomo. This process ensures that developers have no access to Matomo, while restricting the Matomo administrator’s access to applications.
📢 New: Migrate Google Analytics data to Matomo
As we mentioned, you can now use the extension to migrate your Google Analytics data to Matomo. It might be challenging to determine the right database sizing , due to Google Analytics’ opacity regarding its metrics.
With this in mind, we suggest you keep an eye on your database metrics and opt for a gradual increase in storage capacity. To facilitate this procedure, Matomo provides a detailed guide to migration.
Conclusion
Clever Cloud not only facilitates the deployment of on-demand applications and services in the form of add-ons. In addition, we include an integrated suite for all our customers, offering in-depth monitoring of application and database activity, as well as automatic and adaptive scaling capabilities.
Whether you’ve opted for Matomo or one of our other add-ons, we’re always listening to our customers’ needs, so we can continually improve the services we offer. We look forward to hearing from you!