This post contains a container file which aims to be feature-complete for Google Tag Manager for WordPress (gtm4wp): loads of variables, triggers and tags.
Google Tag Manager Cookie Consent dialog
On this page, you can download a Google Tag Manager (GTM) Container that contains a Cookie Consent (opt-in) dialog box, and a set of triggers to use for “opt-in” and “opt-out” tags. No external scripts are needed for it to function.