klaro-org / klaro-js

Klaro Privacy Manager. An open-source, privacy-friendly & compliant consent manager for your website.

Home Page:https://klaro.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Status of Google Tag Manager should toggle status of dependent services

pingpool opened this issue · comments

I use Google Tag Manager (currently only) to include Google Analytics. Google Tag Manager and GA are included 100% following the description in the tutorial, and integration is working so far as expected.

Both services - GTM and GA - are configured as "optional", meaning they can be activated / deactivated by the website visitor.

The "problem" now is, that their status appears to be handled by Klaro.js independently from each other where in fact GA depends on GTM.

For instance:

  • GTM and GA both are "active"
  • visitor deactivates GTM and hits "Save"
  • GA remains as "active", at least it is shown as still active even though it would expect it (by logic) to be shown as "deactivated" because it needs GTM to work

My question is, how can I (automatically) deactivate GA when the visitor deactivates GTM or at least show GA as inactive when GTM is inactive?

Ideally - when the user hits the GTM toggle and that toggle changes from "green" to "red", at the same time the GA-toggle should also change from "green" to "red".

Am I missing something? Thanks for any suggestions / hints ...

Hi @pingpool! This is indeed a tricky issue. We're working on an API integration for the tag manager to make this easier, but that will be a feature of the hosted version only as it requires a backend infrastructure.

What we could do in the OS version is to add a dependsOn field for a service, that could then automatically trigger the behavior you described. Would that solve your issue?

Hi @adewes, i'm really not sure wether a dependsOn field would solve the problem and cover all possible situations. A "simple" field like that would make it relying completly on how the logic linked with it is implemented.

For instance I would assume that - in my case - deactivating GTM would also deactivate the dependent apps (and ideally immediately change the toggle as well), whereas reactivating GTM leaves all dependent deactivated (until the visitor actively activates them again).

But maybe there are situations where developers want everything activated automatically when re-activating the GTM.

So maybe it's better to make it possible to be able to change the consent status of apps through some callback in the config of an app.

I was already trying to do something like

callback: function(consent, app) {
    if (consent == false) klaro.getManager().updateConsent('google-analytics', false)
},

or

onDecline: `
    klaro.getManager().updateConsent('google-analytics', false)
`,

but this led to some kind of recursion (max call stack size exceeded), because this is obviously not an intended "use case" :) (?)

commented

@adewes is there any update for this being at least in the paid version?

Hi @modelesque, yes we have this on our roadmap but I don't think we can offer this for the open-source version as it requires an API integration with GTM, which in turn requires the Klaro backend to function. I'll keep you posted on this (and sorry that it takes a while)!

is there any chance of "dependsOn" will be implemented in the OS version?
i guess for most usecases it would be an acceptable solution if enabling dependant services would automatically activate the tag manager. (with no overcomplicated logic)

this would be highly appreciated as with upcoming GDPR regulations any integration of US services would be not legal anymore and therefore GTM cannot be configured as "required"