Support » Plugin: GDPR Cookie Compliance (CCPA, PIPEDA ready) » Static script injection implemented?

  • Resolved pako69


    Can you please explaine us what is the new “Static script injection implemented”?

Viewing 1 replies (of 1 total)
  • Plugin Author Moove Agency


    Hi @pako69,

    Thanks for using our plugins.

    Our plugin injects the defined scripts based on user consent using JavaScript & AJAX. This is not something you can cache on server level otherwise the scripts will be injected even if they were rejected or inverse. For this purpose, we are using AJAX and not PHP functions. So the plugin should check the user consent, stored in “moove_gdpr_popup” cookie and load the relevant script. When the cookie expires, the cookie banner will be visible again and the user should give the consent to load cookie scripts.

    For this reason, to reduce the server requests we have implemented a static script injection feature, which includes all your scripts in an encoded format in the source code. When users give their consent for third-party cookies, for example, the javascript will decode the third party static scripts and inject to the relevant section.

    To enable the static script injection, the following code snippet should be added to functions.php

    add_action( 'gdpr_cc_prevent_ajax_script_inject', '__return_true' );

    Hope this makes sense.

Viewing 1 replies (of 1 total)
  • The topic ‘Static script injection implemented?’ is closed to new replies.