add opt out for mixpanel tracking

This commit is contained in:
Albert Yi
2018-10-22 10:30:45 -07:00
parent c1f70b9a02
commit 5097babfaa
8 changed files with 62 additions and 3 deletions

View File

@@ -84,6 +84,14 @@
$(window).trigger("danbooru:error", msg);
}
</script>
<script>
window.Danbooru.mixpanelInit(
<%= CurrentUser.id %>,
<%= raw session.id.to_json %>,
<%= CurrentUser.opt_out_mixpanel? %>,
<%= raw({"$created" =>CurrentUser.created_at.strftime('%F %T'), "$name" => CurrentUser.name, "level" => CurrentUser.level, "upload_count" => CurrentUser.post_upload_count, "post_update_count" => CurrentUser.post_update_count, "note_update_count" => CurrentUser.note_update_count, "favorite_count" => CurrentUser.favorite_count}.to_json) %>
);
</script>
</head>
<%= tag.body **body_attributes(CurrentUser.user) do %>