Using Tag Manager with user consent

I want to implement the Matomo Tag Manager and need to offer an option to the user to activate it.

For the “classic” integration there is the rememberConsentGiven (documentation method. But I couldn’t find an option for the Tag Manager API. Any help?