I'm not sure if I understand this question since the whole purpose of the Analytics is to send data to Google for reporting. That creates a GDPR issue only, if not communicated properly to the users.
If you are looking for a way to dynamically switch off the sending, either @IgnoredView or removing the programmatically created instance should work.
Hey @Tino11 , server-side tracking might actually solve your problem more cleanly than trying to disable things client-side. Since everything goes through your server first, you have full control over what gets sent before it even reaches Google — so consent logic is much easier to enforce.