If you use a cookie for Matomo tracking than yes, you need consent. You are using a cookie for a non essential service (analytics), so you need to ask consent.
But you can use Matomo as cookieless: https://matomo.org/cookie-consent-banners/
If matomo gathers data without a cookie, you can still use technical / essential cookies without consent.
As an example Github.com, owned by Microsoft, does not have a cookie consent popup and sets at least 5 cookies as soon as you open it:
- color mode (dark / light)
- user timezone
- whether the user is logged or guest
- a session cookie
- _octo, that I don't understand.