When I'm loading the script in the head tag with the key like this (
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=feb0916c-XXXXX-XXXX-XXXX-XXXXXXX"> </script>
) everything works fine,
But when i'm trying to load the widget dynamically like the following:
var loadScript = function() {
var node = document.createElement('script');
node.src = 'https://static.zdassets.com/ekr/snippet.js?key=feb0916c-XXXXX-XXXX-XXXX-XXXXXXX';
node.type = 'text/javascript';
node.async = true;
node.charset = 'utf-8';
document.getElementsByTagName('head')[0].appendChild(node);
}
loadScript();
i get 429 error.
i need to load the widget dynamically because i use different key for different brands that we have.
any idea why?
i can provide screenshots of the network request if needed.