This Magento 2 module integrates a consent cookiebanner and lets Tag Manager know what the selected options are. This module uses the Yireo Google Tag manager module
composer require starringjane/cookie-banner
bin/magento module:enable StarringJane_CookieBanner
bin/magento setup:upgrade
- Enable the Yireo tag manager module
bin/magento config:set --lock-config web/cookie/cookie_restriction 1
bin/magento cache:clean