Hope someone can help me with this.
I want to insert a getsitecontrol.com script to ask our members to subscribe to a newsletter. But I want this only to be shown for members.
I tried doing this using jQuery in Admin > Customize > CSS/HTML >
<script>
$(document).ready(function(){
if((Discourse.User.current()))
{ $('<script>')
.attr('type', 'text/javascript')
.text('(function (w,i,d,g,e,t,s) {w[d] = w[d]||[];t= i.createElement(g);
t.async=1;t.src=e;s=i.getElementsByTagName(g)[0];s.parentNode.insertBefore(t, s);
})(window, document, '_gscq','script','//widgets.getsitecontrol.com/xxxx/script.js');')
.appendTo('body');
}
else { //Do nothing or show someother message
}});
</script>
But it doesn’t seem to work. No errors on the console too. Can someone help please?