You could say that Complianz and flying scripts do something similar: they prevent a script from being executed until a certain condition is met. In the case of Complianz, this condition is the user consent. For flying scripts, it’s user activity or time out.
If you delay the Complianz scripts with flying scripts, and remove the consent requiring scripts from Flying scripts, I would expect this to achieve the required result: scripts are blocked, and when Complianz fires it can unlock the other scripts.
Alternatively, if you don’t delay Complianz, all scripts will be blocked if the user has not given consent, resulting in the delayed experience. But if the user already has given consent, all scripts will start running as soon as the page has loaded completely.
In both cases you don’t need to add scripts to flying pages if they’re already handled by Complianz.
I haven’t tested this, but these are the configurations I would check first.
Thanks for your response Rogier!
My only concern with removing the consent-requiring scripts from Flying Scripts is I’m afraid of my load times will taking a hit. And that’s the main reason I’ve got them delayed in the first place. Maybe that won’t happen if I remove them from Flying Scripts though.
I hope I’m not being dense here. Please correct me if I’m not understanding correctly.
For Complianz to work correctly, do its scripts have to load before any consent-requiring scripts?
I imagine loading consent-requiring scripts via my Flying Scripts setup could potentially make the cookies fire without user consent? Or is that incorrect? Maybe Complianz has to have that user interaction of clicking “accept” before letting any consent-requiring JS load – regardless of whether or not my Flying Scripts setup is trying to have those scripts execute after timeout of 5 seconds.
If I remove the consent-requiring scripts from Flying Scripts, are you saying they’ll be delayed until user interaction of clicking “accept” on the cookie notice bar occurs? effectively, I guess that would give me the same effect Flying Scripts is currently providing for those consent-requiring scripts?
In a perfect world (at least in my mind if I’m understanding how Complianz works) Complianz scripts could be delayed until the page has finished loading. And after that point, any consent requiring scripts would only be executed if a user accepts cookies via the cookie bar. So that would be a user interaction based delay instead of my Flying Scripts delay of 5 seconds after timeout.
Is that what you’re saying? I feel like I may have just said what you were getting at but in my own way, LOL. Please inform me otherwise if I’m missing it. Again, I’m just trying to have the best load times possible while still properly abiding by these cookie consent laws.
@matchlessweb By default, Complianz implements a form of lazyloading as well. With a standard implementation, Complianz is loaded in the footer and then unblocks scripts for which consent has been provided and keeps other scripts blocked.
Our assumption is that if you delay the Complianz script and let Complianz handle all the other ‘consent-requiring’ scripts, that you will achieve your goal as well: all scripts get delayed with 5 seconds. After these 5 seconds, Complianz will unblock scripts for which consent has been provided.
We’d be interested to hear if this works out of the box indeed!
Kind regards,
Leon
Ok, I’m going to give this a shot right now. I hope it works! I’m using the Perfmatters plugin to quickly identify scripts associated with the Complianz plugin: screenshot of the 3 JS files: https://cln.sh/mez1Qb
Scripts are:
cookieconfig.min.js
cookieconsent.min.js
postscribe.min.js
Do you think it’s safe to delay all three files using Flying Scripts? Or would any of them still need to load in their normal position while only delaying one or two with Flying Scripts?
First test of delaying all 3 scripts resulted in the console error seen here: https://cln.sh/HcybCJ
Removing cookieconfig.min.js from Flying Scripts while leaving cookieconsent.min.js and postscribe.min.js gets rid of the console error, but I can see my GTM scripts are still firing before the accept button is clicked on the cookie bar. So maybe some other combination of delaying vs. not delaying these 3 scripts might be needed?
Or maybe my triggers for FB Pixel and Active Campaign are setup incorrectly? I’ve tried to setup the events triggers as described in this tutorial: https://complianz.io/definitive-guide-to-tag-manager-and-complianz/
But maybe I’ve done something wrong there since the scripts are still firing before the accept button has been clicked. Here’s a screenshot of my triggers for FB Pixel and ActiveCampaign Site tracking: https://cln.sh/ZPAKEw Let me know if that looks wrong (I’m sure it is).
I’m assuming the Google Analytics should also be blocked before consent is given, but I haven’t got a GTM trigger in place for that at the moment. So please let me know if that’s needed. I think I got confused by my duplicate analytics issue from my other thread related to this issue. So I removed the analytics trigger for now. I feel like I read somewhere in the documentation that some scripts are blocked by default by Complianz, so I’m unsure if I need a GTM analytics script to be inserted or not being that I already configured Complianz to use my GTM container to insert the scripts.
If you have recommended settings for the analytics trigger, I’m all ears 🙂
Also worth mentioning, the only thing entered in my Script Center settings is “activecampaign-subscription-forms” which I gathered was supposed to be there because I’m inserting my tracking script with GTM. Screenshot here: https://cln.sh/YbKoFD
This is the documentation on ActiveCampaign setup I followed:https://complianz.io/configuring-activecampaign/
Side Note regarding GTM categories: Though I’ve tried setting up custom event triggers in GTM, I don’t see these options appearing in my Complianz plugin settings:
https://cln.sh/QdSaQS
I assume when setup correctly I should have the toggles appear in my cookie banner as seen in thie screenshot: https://cln.sh/wxIPTx from this article: https://complianz.io/definitive-guide-to-tag-manager-and-complianz/
Word vomit I know. Thanks for being patient with me as I try to wrap my head around making this work.
Plugin Author
Aert
(@aahulsebos)
Hi @matchlessweb,
Let’s start with correctly setting the custom events with Google Tag Manager;
Because your configuration is as such: https://cln.sh/QdSaQS
These are your custom events;
Functional = cmplz_event_functional
Statistics = cmplz_event_0
Facebook = cmplz_event_1
Marketing = cmplz_event_marketing
You can create a trigger with a custom event that’s equal to the custom event provided above. Afterward, this should trigger the Tag which correlated to the category on your banner.
For example; if you trigger ActiveCampaign from Google Tag Manager, you don’t have to block it with the Script Center, only if you use a plugin as well, or instead of Tag Manager.
If you want, you can go into preview mode of your Tag Manager container (top right-hand corner in Tag Manager) and share the preview with a link.
This way I can check if the events are set up correctly.
Let me know,
regards Aert
Hi Aert,
Here’s a preview link of my Tag Manager setup: Preview here
One thing I experimented with since my original message is not allowing Complianz to handle my “statistics” as it’s labeled. I was getting a message saying I had duplicate analytics running on my site, so I’ve turned that off and now I’m just using GTM to inset my analytics code. Here’s a screenshot of the current tags (I know that screenshot alone doesn’t tell you everything about the tags): https://cln.sh/LXG4Ff
Presently, it seems only one facebook related cookie is being blocked before consent is granted by clicking the accept button on my cookie banner. I’m sure you can help me determine what I’ve configured wrongly here.
And FYI, I do still have all 3 scripts assoicated with Complianz being delayed by Flying Scripts as of this message.
Hi @matchlessweb,
Please change the answer to your statistics question to “Yes, with Google Tag Manager” and enter your GTM code in the wizard.
Kind regards,
Leon
Hey Leon, I have done as you recommended.
I originally had things set up that way, but I was getting a “duplicate analytics” notice (maybe related to something I was doing wrong as discussed in this post: https://complianz.io/duplicate-implementation-of-analytics/) in the Complianz plugin dashboard in WP Admin, so I toggled it off and was just inserting my Analytics using GTM.
This is the current GTM preview link
It seems I’ve still got scripts firing before consent has been granted via clicking the “accept” button on the cookie banner. Any ideas what I might be doing wrong?
Do you think using Flying Scripts to delay the Complianz JS files until 5 seconds after the page has loaded is causing issues with Complianz plugin functionality?
Plugin Author
Aert
(@aahulsebos)
Hi @matchlessweb,
To start over quickly, I am correct in saying you have chosen the US as a region.
Therefore firing your script before consent is allowed. It’s only after revoking consent, on your cookie policy, the scripts should be blocked.
If this is correct, your GTM is configured correctly, all you need is to enable our cookie policy, or add a shortcode to your current policy.
You can hide a link if you need, they seem to link to the same policy.
regards Aert
Ahh that makes sense! Ok cool. I’m fully intending on buying the premium version of this plugin to be able to have this plugin configured for all regions in the world. I just want to be sure I can get the performance benefits of using Flying Scripts if I use the premium version of this plugin.
If I had this configured for GDPR, would it make those tracking scripts get blocked until someone clicks the “accept” button? I’m wanting to be extra sure this Flying Scripts configuration won’t break such a feature in Complianz.
I’d hate for my attempts at speed optimization to harm make my efforts towards compliance with these cookie-related privacy laws. I’m thinking I could safely purchase the premium version and experiment with this further.
I think I may just be confused about which events or custom events should fire from GTM before or after consent has been granted.
Hi @matchlessweb,
Yes, this setup should work for the EU as well. You could test this with the Free plugin as well, by temporarily switching the selected region to the EU. Please do remember to clear your site cache before testing.
If you do have questions about our Premium plugin, we are happy to help but we need to ask to you reach out to us via https://complianz.io/support. This forum is for Free WordPress plugins only.
Kind regards,
Leon
Hi @matchlessweb
Great to hear that your issue is resolved! Could you tell us what you think of the plugin or the support by casting your Review here? We’d love to hear your feedback!