We have implemented a method to hide 3rd party content (especially Youtube) if the end user hasn’t accepted required cookies. This is in Drupal and has been done with Drupal Cookie blocker module and Javascript, referencing Piwik Pro API ( we use e.g. ppms.cm.api(‘getComplianceSettings’, onFulfilled, onRejected);)
The implementation works great otherwise but the analytic tags are not firing. Has someone implemented similar way to disable cookies before content and the tags are firing fine?
hey @marleena - I’m not sure if I fully understand what you want to achieve, but have you considered sending additional dataLayer push after cookies have been accepted and just use it to trigger tags you want to fire after consent is granted? Maybe that would solve your issue.
Cookie consent change itself won’t re-trigger tags that didn’t get consent previously, they will fire only when trigger does its job again, ie. on page view event.
Thank you @jfidala! Sorry, I wrote my initial message in a hurry and it is lacking information.
The implementation we have tried is that after the user has accepted cookies and the 3rd party content (i.e. Youtube) content is shown, there is a script that fires up at the same time as hidden content comes visible. That script is from the client, but I understood that it is the same that Piwik fires.
Would you happen to have an example of sending additional dataLayer push? I am a front end dev and this is pretty weird for me.
Hello again, I’m back with more information. Hopefully I can describe the problem better now.
Youtube videos are added to Drupal in Remote video field and that field wraps Youtube embed to an iframe. So there are two iframes at the end. According to my analytics wizard colleague Piwik Pro analytics can find the video but can’t listen to clicks inside of it. So it doesn’t get data. Or optionally it gets the clicks but can’t send them over the nested iframe structure.
I am pretty sure that the client doesn’t want to compromise security and thus wants to keep 3rd party iframes oembedded. But what do I need to do to make Piwik catch the clicks inside nested iFrame? @jfidala mentioned sending an additional dataLayer push, would it be best to add it to the Youtube tag code?