Skip to content

Instantly share code, notes, and snippets.

@blaswan
Created January 19, 2017 08:22
Show Gist options
  • Save blaswan/4c9f30051e23ac5df8b6260e81c8d86b to your computer and use it in GitHub Desktop.
Save blaswan/4c9f30051e23ac5df8b6260e81c8d86b to your computer and use it in GitHub Desktop.
<!-- Channel Plugin Scripts -->
<script>
window.channelPluginSettings = {
"plugin_id": "YOUR_PLUGIN_ID",
"user": {
"id": "YOUR_USER_ID",
"name": "YOUR_USER_NAME",
"mobileNumber": "YOUR_USER_MOBILE_NUMBER",
"meta": {
"CUSTOM_VALUE_1": "VALUE_1",
"CUSTOM_VALUE_2": "VALUE_2"
}
}
};
(function() {
var node = document.createElement('div');
node.id = 'ch-plugin';
document.body.appendChild(node);
var async_load = function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//cdn.channel.io/plugin/ch-plugin-web.js';
s.charset = 'UTF-8';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
};
if (window.attachEvent) {
window.attachEvent('onload', async_load);
} else {
window.addEventListener('load', async_load, false);
}
})();
</script>
<!-- End Channel Plugin -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment