onAccept: function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'marketingConsentGiven' });
The GDPR only requires explicit opt in consent for cookies which store private data. Implicit consent is fine for other cookies. As long as you have advertising features turned off in GA and use the anonymise IP function you can fire the cookie with out explicit opt in.
Check Simo Ahava blog for turning on off advertising functions in GA if you need them.