Hi @andioh,
Thank you.
Well. Inserting javascript code directly into a WordPress page like this is a bad practice.
The idea is that you paste your content there, not a JS code. The plugin keeps track of policy updates to display this screen to your users to re-consent. It’s impossible to do that if you use a JS function to load your content.
Anyway,
Did you wrap your js in <script></script> tags? From what I’ve read, that should make it work.
Hi,
yes it’s wrapped in the script tags. However it’s not working.
Iubenda is providing the script code, so the policy is always up to date.
Any other ideas to try?
Thanks!
The policy can be up to date, but you can’t update the policy and not notify your users and get new consent from them.
If you fill the content instead of using the script, whenever you make a change the plugin will prompt you to ask your users for consent. I don’t do it automatically because you might have just fixed a typo.
With this script that will be impossible.
Allowing scripts like this is not safe.
Unless this turns into a popular request, I don’t think I’ll implement this.
I’m sorry :/
Hi,
Thanks for your reply.
The problem is, iubenda only allows to integrate their Privacy Policy via the script.
So I have no chance to just copy the plain text into it.
No chance that you change your mind? I get informed by iubenda when there are changes to the policy, so I manually can ask for new consent.
Thank you!
Hi @andioh,
Download 1.3.1 and try again.
If that doesn’t work, try removing the script from the page and adding the following to your functions.php. Let me know if that works.
add_filter( 'the_content', 'my_content_addition' );
function my_content_addition( $content ) {
$privacy_policy_page = get_option( 'gdpr_privacy_policy_page', 0 );
if ( ! $privacy_policy_page || ! is_page( $privacy_policy_page ) ) {
return $content;
}
$before = '<script type="text/javascript">(function (w,d) {var loader = function () {var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src = "//cdn.iubenda.com/iubenda.js"; tag.parentNode.insertBefore(s,tag);}; if(w.addEventListener){w.addEventListener("load", loader, false);}else if(w.attachEvent){w.attachEvent("onload", loader);}else{w.onload = loader;}})(window, document);</script>';
return $before . $content;
}
Just make sure you have the correct script. I’m not sure if I have.
Works perfekt now, thank you!