Google Tag Manager to be used for statistics AND marketing stuff
-
hello!
we have already found a lot of information on how to set up complianz and google tag manager correctly.
i would like to hear your opinion on a scenario we would like to achieve:
- we want to use google tag manager for GA4 as well as marketing-pixels like linkedin insight tag
- i already know that we can use the complianz events like cmplz_event_statistics or cmplz_event_marketing to fire these tags in tag manager
- i would also like that (empty) tag manager is only loaded after opt-in. i found a tutorial for this (https://complianz.io/how-to-set-google-tag-manager-after-consent-and-is-it-needed/), but this tutorial will only load the tag manager after statistics opt-in.
- we would need a script or a solution that includes tag manager if only one of these categories has been selected for opt-in, as well as for multiple categories.
i think of something like this javascript:
if(cmplz_has_consent('statistics')||cmplz_has_consent('marketing')){ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXXXXX'); }
what i do not like with this solution is:
- this script would need to be included somewhere in the theme. i don’t know where it would be possible to integrate in complianz, since the script center would again be limited to the selection of one category
- the categories would be hardcoded
i think the best solution would be if you could change the behaviour in script center, so that there is no radio button for the selection of the category when adding scripts, but checkboxes, so that the script is added whenever one of these catogories has been accepted. it could become even more interesting if you add a “and/or” switch, so that one could also limit a script to the opt-in for two ore more categories.
i hope you understand my idea and can point me to a good solution. if you like the idea for the script center as well, it would be great to see this in future releases ??
thanks
matt
- The topic ‘Google Tag Manager to be used for statistics AND marketing stuff’ is closed to new replies.