-
-
Save trun/d58d7cc8597c3b9414274105a76a1f40 to your computer and use it in GitHub Desktop.
Snippet for Gigster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// standard drift snippet | |
!function() { | |
function t() { | |
t.__q.push(Array.prototype.slice.call(arguments)); | |
} | |
t.__q = []; | |
var e = window.drift = window.driftt = window.drift || window.driftt || t, i = [ "identify", "init", "track", "reset", "debug", "show", "ping", "page", "hide", "off", "on", "config" ]; | |
i.forEach(function(t) { | |
e[t] || (e[t] = function() { | |
e.apply(null, [ t ].concat(Array.prototype.slice.call(arguments))); | |
}); | |
}), e.load = function(t) { | |
var i = 3e4 * Math.ceil(new Date() / 3e4), n = document.createElement("script"); | |
n.type = "text/javascript", n.async = !0, n.crossorigin = "anonymous", n.src = "https://js.driftt.com/include/" + i + "/" + t + ".js"; | |
var o = document.getElementsByTagName("script")[0]; | |
o.parentNode.insertBefore(n, o), e.init(t); | |
}; | |
}(); | |
drift.SNIPPET_VERSION = '1.0.0'; | |
// put the widget in "iframe" mode so it expands to the full frame | |
// also disables closing the sidebar and starting new conversations | |
drift('config', { | |
iframeMode: true, | |
disableNewConversations: true, | |
disableSidebarClose: true, | |
}); | |
// acknowledge iframe resizes unblock the widget render | |
drift('on', 'iframeResize', function() { | |
drift('acknowledgeIframeResize'); | |
}); | |
// automatically open sidebar when the widget loads | |
drift(function(api) { | |
api.sidebar.open(); | |
}); | |
// trigger a page load event | |
drift('page'); | |
// initialize the widget | |
drift.load('TODO DRIFT EMBED ID GOES HERE'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment