Hey all, I am trying to integrate my site with ClickBank. To do so I need to implement the “Clickbank Trust Badge” to my website via Javascript. Now, CB’s own website says that WIX is not supported, however I’ve managed to successfully run the script on my site’s preview, so I have hope. My issue is that the badge disappears when I move to the live site.
I’ve managed to get the preview working by adding a ‘Custom Element’ via ‘Custom Embed’ and linking that directly to the source code:
//cbtb.clickbank.net/?vendor=mbscn
As I stated - that works well enough on the preview version, but is missing entirely on the live site.
Here’s the source code:
(function () { if (document.compatMode === 'CSS1Compat') { var js = document.createElement('script');
js.type = 'text/javascript';
js.src = 'https://prod.cbstatic.net/dist/injectable.js'; var head = document.getElementsByTagName('head')[0];
head.insertBefore(js, head.childNodes[0]); var cbtbLoaded = false;
js.onload = js.onreadystatechange = function () { if (cbtbLoaded === false && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) { cbtbLoaded = true; var clientLocale = 'en'; if (window.navigator.languages && window.navigator.languages.length > 0) { clientLocale = window.navigator.languages[0]; } else { clientLocale = window.navigator.language ? window.navigator.language : window.navigator.userLanguage; } clientLocale = clientLocale ? clientLocale.substring(0, 2) : 'en';
window.cbtb({ distUrl: 'https://prod.cbstatic.net/dist/', theme: 'dark-grey', position: 'bottom-right', type: 'tab', locale: clientLocale }); } }; } })();
Any ideas? Would love if this wasn’t a complete wash. Thanks in advance.