WordPress load javascript file if something… (after the page is loaded)
try now this code <script type=”text/javascript”> function CookiebotCallback_OnAccept() { if (Cookiebot.consent.marketing) { var script = document.createElement(‘script’); script.src = “https://wordpress.stackexchange.com/wp-content/plugins/instagram-feed/js/sb-instagram.min.js”; document.body.appendChild(script); } }