Google Adjust tag behavior based on consent - setting up Consent Mode

Hello,

I have some seriously problem with this recomandation from Google Ads, i’ve tried to change it but it dosen’t seem to work and i’m worried that i will have some issue to my script code if I’m stil going to modify again and again the script.

Can anyone help me with this?

And this is my script… I know it’s look bad but it’s working ok…

I’m very interested in this too. Due to the consent banner, 30% of our sales are missing in Google Analytics and Ads.

Already spend hours researching for the answer and tried different things, but nothing works.

And nobody seems to have an answer. Not Shopify, nor app developers. Really annoying.