Title: Static script injection implemented?
Last modified: February 29, 2020

---

# Static script injection implemented?

 *  Resolved [pako69](https://wordpress.org/support/users/pako69/)
 * (@pako69)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/static-script-injection-implemented/)
 * Hi
    Can you please explaine us what is the new “Static script injection implemented”?
   Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [Moove Agency](https://wordpress.org/support/users/mooveagency/)
 * (@mooveagency)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/static-script-injection-implemented/#post-12501945)
 * Hi [@pako69](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/gdpr-cookie-compliance/assets/icon-256x256.png?rev=2376316)
 * [GDPR Cookie Compliance - Cookie Banner, Cookie Consent, Cookie Notice for CCPA, EU Cookie Law](https://wordpress.org/plugins/gdpr-cookie-compliance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gdpr-cookie-compliance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gdpr-cookie-compliance/)
 * [Active Topics](https://wordpress.org/support/plugin/gdpr-cookie-compliance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gdpr-cookie-compliance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gdpr-cookie-compliance/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Moove Agency](https://wordpress.org/support/users/mooveagency/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/static-script-injection-implemented/#post-12501945)
 * Status: resolved