Hi, could someone explain me how to encapsulate the code for scripts that are loaded outside Piwik tag manager? I have done it with other CMP’s but I couldn’t find a clear explanation.
Hi
I was about to ask the same thing. It took a look at few “script blocking” solutions which were quite heavy but something similar should be used and hooked to Piwik API to allow script loading after consent is given.
I think that Piwik API should be extended to provide a mechanism for this since it already has a blocking mechanism which should be easily integrated to other scripts for example by adding classes or custom attributes to script tags. It that case it wouldn’t “interfere” with the system were it is installed but would provide a way to integrate it and thus enabe control of scripts per consent.
Hi,
With other CMPs they usually have a script that does the job. I would really need a similar solution that works with Piwik Pro CMP. Just an example below.
type="text/plain" data-cookieconsent="analytics
Hi. Thanks for the feature request - I’ll forward it to the product team.
As a side note, it’s a double-edged sword. So, blocking only elements with the data-consent tag would be the way to go.
Hi! Blocking single elements/scripts is exactly what I’m trying to do here. Did your product team come up with anything yet?
We’re working on a guide describing how to do it with the current feature set. It should be published within the next few weeks.
Hi, is there an update on this? I couldn’t find anything in the developer documentation. This would really help me a lot.
hello @saschafuss
Have you considered using this function:
You can call it in your script after Piwik PRO Tag Manager was initialized and check if consent was given - then block or run script based on status
variable.
Hi @jfidala,
thanks for your quick reply! I was hoping there would be a simpler solution for this, such as using HTML attributes within the <script>
tag.
I’d like to use Google Tag Manager alongside the Piwik Tag Manager, but GTM should only load after the visitor has made their consent decision.
Would you recommend implementing GTM through the Piwik Tag Manager, or would it be better for performance to use the getComplianceSettings()
function?
Maybe there is an easier way to solve your problem - check this article please:
@jfidala
Thanks, this article is helpful when adding tags in GTM and checking for user permission before firing them.
However, if I understood correctly, it doesn’t explain how to block the loading of GTM itself until after the user has given consent, right?
@saschafuss
You can do custom script with getCompilanceSettings
for loading GTM, or integrate with consent manager and pass consent to each script inside GTM - which also gives you more control since you are passing specific consent to tag.
@jfidala great, thanks. I will give it a try.