Adding Drift.

master
Nick Sergeant 2016-10-25 11:18:05 -04:00
parent 34c6a63fb3
commit 6657c4f301
1 changed files with 22 additions and 21 deletions

View File

@ -1,4 +1,4 @@
{% load snipt_tags intercom %} {% load snipt_tags %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" class="{% block html-class %}{% endblock %}" ng-app="Snipt"> <html lang="en" class="{% block html-class %}{% endblock %}" ng-app="Snipt">
@ -444,29 +444,30 @@
</div> </div>
{% if request.user.is_authenticated and not debug %} {% if request.user.is_authenticated and not debug %}
<!-- Start of Async Drift Code -->
<script> <script>
window.intercomSettings = { !function() {
app_id: 'sajf131y', var t;
user_id: {{ request.user.id }}, if (t = window.driftt = window.drift = window.driftt || [], !t.init) return t.invoked ? void (window.console && console.error && console.error("Drift snippet included twice.")) : (t.invoked = !0,
user_hash: '{{ request.user.id|intercom_sha_256 }}', t.methods = [ "identify", "config", "track", "reset", "debug", "show", "ping", "page", "hide", "off", "on" ],
email: '{{ request.user.email }}', t.factory = function(e) {
created_at: {{ request.user.date_joined|date:"U" }}, return function() {
custom_data: { var n;
'snipts count': {% snipts_count_for_user %}, return n = Array.prototype.slice.call(arguments), n.unshift(e), t.push(n), t;
'profile link': 'https://snipt.net/{{ request.user.username }}/', };
'blog domain': '{{ request.user.profile.blog_domain }}', }, t.methods.forEach(function(e) {
'pro date': {% firstof request.user.profile.pro_date|date:"U" 'null' %}, t[e] = t.factory(e);
'username': '{{ request.user.username }}' }), t.load = function(t) {
} var e, n, o, i;
}; e = 3e5, i = Math.ceil(new Date() / e) * e, o = document.createElement("script"),
</script> o.type = "text/javascript", o.async = !0, o.crossorigin = "anonymous", o.src = "https://js.driftt.com/include/" + i + "/" + t + ".js",
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/sajf131y';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script> n = document.getElementsByTagName("script")[0], n.parentNode.insertBefore(o, n);
<script type="text/javascript">
FS.identify('{{ request.user.id }}', {
displayName: '{{ request.user.username }}',
email: '{{ request.user.email }}'
}); });
}();
drift.SNIPPET_VERSION = '0.3.0'
drift.load('bx8pi58c2e5h')
</script> </script>
<!-- End of Async Drift Code -->
{% endif %} {% endif %}
{% include 'analytics.html' %} {% include 'analytics.html' %}