Created
September 22, 2016 08:49
-
-
Save jelukas/7e5a3ec6b56a2a292bb0a26150ce56ce to your computer and use it in GitHub Desktop.
base.html - fragment , thisis in base html so it used in all templates (Django).
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
{% if request.user.is_authenticated %} | |
<!-- Customer.io Tracking --> | |
<script type="text/javascript"> | |
var _cio = _cio || []; | |
(function() { | |
var a,b,c;a=function(f){return function(){_cio.push([f]. | |
concat(Array.prototype.slice.call(arguments,0)))}};b=["load","identify", | |
"sidentify","track","page"];for(c=0;c<b.length;c++){_cio[b[c]]=a(b[c])}; | |
var t = document.createElement('script'), | |
s = document.getElementsByTagName('script')[0]; | |
t.async = true; | |
t.id = 'cio-tracker'; | |
t.setAttribute('data-site-id', '{{ customerio_site_id }}'); | |
t.src = 'https://assets.customer.io/assets/track.js'; | |
s.parentNode.insertBefore(t, s); | |
})(); | |
</script> | |
<script type="text/javascript"> | |
_cio.identify({ | |
// Required attributes | |
id: '{{ request.user.id }}', // Unique id for the currently signed in user in your application. | |
email: '{{ request.user.email }}' // Email of the currently signed in user. | |
}); | |
</script> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment