Skip to content

Commit

Permalink
guard against no userId cookie when initializing analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron committed Mar 2, 2016
1 parent c391dcf commit d8aa247
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
: "Bksiqv27kRC1fOASWhC7j9fIIgB9YDVv");
}}();
var id = document.cookie.match(/userId=([^;]*)/);
id[1] && analytics.identify(id[1]);
id && id[1] && analytics.identify(id[1]);
analytics.page('docs' + document.location.pathname);
</script>
{% endblock %}

0 comments on commit d8aa247

Please sign in to comment.