Title: add scripts after accept cookie
Last modified: October 7, 2024

---

# add scripts after accept cookie

 *  Resolved [vinnard](https://wordpress.org/support/users/vinnard/)
 * (@vinnard)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/add-scripts-after-accept-cookie/)
 * Hi.
 * I need help with my script and cookie
 * I have this script that adds a widget to the website:
 *     ```wp-block-code
       <script type="text/javascript">(function(d, w, s) {var widgetHash = 'ldPlpmhFEP2znaSryO0B', bch = d.createElement(s); bch.type = 'text/javascript'; bch.async = true;bch.src = '//widgets.binotel.com/chat/widgets/' + widgetHash + '.js';var sn = d.getElementsByTagName(s)[0]; sn.parentNode.insertBefore(bch, sn);})(document, window, 'script');</script>
       ```
   
 * The plugin blocks it, and the widget is not displayed on the site.
   How can I 
   allow this script to execute only after the user accepts the cookies?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [vinnard](https://wordpress.org/support/users/vinnard/)
 * (@vinnard)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/add-scripts-after-accept-cookie/#post-18060128)
 * website: [https://bpozenko.com/](https://bpozenko.com/)
 * error screen [https://imgur.com/a/VfZK35Q](https://imgur.com/a/VfZK35Q)
    -  This reply was modified 1 year, 7 months ago by [vinnard](https://wordpress.org/support/users/vinnard/).
 *  Plugin Support [CookieYes Team](https://wordpress.org/support/users/cookieyesteam/)
 * (@cookieyesteam)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/add-scripts-after-accept-cookie/#post-18062471)
 * Hi [@vinnard](https://wordpress.org/support/users/vinnard/)
 * Greetings from CookieYes!
 * It looks like you’re currently using a third-party cookie banner plugin instead
   of CookieYes. If the issue occurred while using CookieYes, please keep it active
   so we can investigate further and provide you with an effective solution.
 *  Plugin Support [CookieYes Team](https://wordpress.org/support/users/cookieyesteam/)
 * (@cookieyesteam)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/add-scripts-after-accept-cookie/#post-18073133)
 * Hi [@vinnard](https://wordpress.org/support/users/vinnard/)
 * This thread has been inactive for a bit, so we are going to mark it as resolved
   now. Please feel free to open a new thread or follow-up if you have any further
   questions or still need help.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘add scripts after accept cookie’ is closed to new replies.

 * ![](https://ps.w.org/cookie-law-info/assets/icon.svg?rev=3007243)
 * [CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)](https://wordpress.org/plugins/cookie-law-info/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-law-info/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-law-info/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-law-info/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-law-info/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-law-info/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [CookieYes Team](https://wordpress.org/support/users/cookieyesteam/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/add-scripts-after-accept-cookie/#post-18073133)
 * Status: resolved