Commits

Branko Vukelic committed 4a2c784

Added support for automatic user identification

  • Participants
  • Parent commits 4a4a594

Comments (0)

Files changed (1)

File heap/templates/heap/script.html

 <script type="text/javascript">
     var heap=heap||[];heap.load=function(a){window._heapid=a;var b=document.createElement("script");b.type="text/javascript",b.async=!0,b.src=("https:"===document.location.protocol?"https:":"http:")+"//d36lvucg9kzous.cloudfront.net";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c);var d=function(a){return function(){heap.push([a].concat(Array.prototype.slice.call(arguments,0)))}},e=["identify","track"];for(var f=0;f<e.length;f++)heap[e[f]]=d(e[f])};
     heap.load("{{ HEAP_APP_ID }}");
+    {% if HEAP_AUTO_ID_USER and user.is_authenticated %}
+    heap.identify({name: '{{ user.get_full_name }}'{% if user.email %}, email: '{{ user.email }}'{% endif %}});
+    {% endif %}
 </script>
 {% endif %}