Skip to content

Instantly share code, notes, and snippets.

@Chippd
Created January 4, 2020 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chippd/60c5a51af11b26fbe72d260bf82cadf5 to your computer and use it in GitHub Desktop.
Save Chippd/60c5a51af11b26fbe72d260bf82cadf5 to your computer and use it in GitHub Desktop.
export default () => {
!function() {
var t = window.driftt = window.drift = window.driftt || [];
if (!t.init) {
if (t.invoked) return void (window.console && console.error && console.error("Drift snippet included twice."));
t.invoked = !0, t.methods = [ "identify", "config", "track", "reset", "debug", "show", "ping", "page", "hide", "off", "on" ],
t.factory = function(e) {
return function() {
var n = Array.prototype.slice.call(arguments);
return n.unshift(e), t.push(n), t;
};
}, t.methods.forEach(function(e) {
t[e] = t.factory(e);
}), t.load = function(t) {
var e = 3e5, n = Math.ceil(new Date() / e) * e, o = document.createElement("script");
o.type = "text/javascript", o.async = !0, o.crossorigin = "anonymous", o.src = "https://js.driftt.com/include/" + n + "/" + t + ".js";
var i = document.getElementsByTagName("script")[0];
i.parentNode.insertBefore(o, i);
};
}
}();
drift.SNIPPET_VERSION = '0.3.1';
drift.load('YOUR-DRIFT-CODE');
};
@Chippd
Copy link
Author

Chippd commented Jan 4, 2020

Gist for nuxt.js plugin file to add Drift to a nuxt web application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment