Files
edx-platform/cms/templates/widgets/segment-io-footer.html
Andy Armstrong b66cbe3484 Upgrade segment.io to match documentation.
May improve performance.
TNL-3538
2015-10-30 09:24:20 -04:00

23 lines
684 B
HTML

% if settings.CMS_SEGMENT_KEY:
<!-- begin segment footer -->
<script type="text/javascript">
% if user.is_authenticated():
// We can't use JQuery's on load method because it
// screws up RequireJS' JQuery initialization.
var onLoadCallback = function() {
analytics.identify("${user.id}", {
email: "${user.email}",
username: "${user.username}"
});
};
if (window.addEventListener) {
window.addEventListener("load", onLoadCallback, false);
}
else {
onLoadCallback();
}
% endif
</script>
<!-- end segment footer -->
% endif