I implemented Segment.io in my Django application. Once the user logs in I have to call analytics.identify once.
Currently, I call it every time on every page load as long {% if user.is_authenticated %} is the case. Do you have any idea how I can only call it once after the user logged in?
<script type="text/javascript">
{% if user.is_authenticated %}
analytics.identify('{{ user.email }}', {
'first_name': user.first_name,
'last_name': user.last_name,
});
{% endif %}
</script>