https://docs.djangoproject.com/en/1.11/releases/1.10/#using-user-is-authenticated-and-user-is-anonymous-as-methods
29 lines
1021 B
HTML
29 lines
1021 B
HTML
<%page expression_filter="h"/>
|
|
<%! from openedx.core.djangolib.js_utils import js_escaped_string %>
|
|
|
|
% if settings.LMS_SEGMENT_KEY:
|
|
<!-- begin segment footer -->
|
|
<script type="text/javascript">
|
|
% if user.is_authenticated:
|
|
$(window).load(function() {
|
|
analytics.identify(
|
|
"${ user.id | n, js_escaped_string }",
|
|
{
|
|
email: "${ user.email | n, js_escaped_string }",
|
|
username: "${ user.username | n, js_escaped_string }"
|
|
},
|
|
{
|
|
integrations: {
|
|
// Disable MailChimp because we don't want to update the user's email
|
|
// and username in MailChimp on every page load. We only need to capture
|
|
// this data on registration/activation.
|
|
MailChimp: false
|
|
}
|
|
}
|
|
);
|
|
});
|
|
% endif
|
|
</script>
|
|
<!-- end segment footer -->
|
|
% endif
|