Cookie consent and Matomo

I’m using the cookie consent plugin on my site, but I have no idea how to make it work with Matomo. Here’s the code they say to use :
Can someone tell me how to use this?

Did you looked here: Matamo site
You simple have to add:

if (type == 'opt-in' && didConsent) {
    } else {
1 Like

All right, wasn’t sure it was as simple as that! Thanks, I’ll try to do that.

Its really that simple. thankyou so much.

Thanks for such information, it really helped, i have found something similar here.