<commit_before>import { getSetting } from 'meteor/vulcan:core';
import { addInitFunction, addIdentifyFunction } from 'meteor/vulcan:events';

function googleTagManagerInit() {
  const googleTagManagerId = getSetting('googleTagManager.apiKey')
  if (googleTagManagerId) {
    (function (w, d, s, l, i) {
    w[l] = w[l] || []; w[l].push({
      'gtm.start':
        new Date().getTime(), event: 'gtm.js'
    }); var f = d.getElementsByTagName(s)[0],
      j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; 
      j.async = true; 
      j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;         
      f.parentNode.insertBefore(j, f);
    })(window, document, 'script', 'dataLayer', googleTagManagerId)
  }
}

addInitFunction(googleTagManagerInit)

const identifyFullStoryUser = (currentUser) => {
  const { karma = 0, afKarma = 0, frontpagePostCount = 0, voteCount = 0, createdAt } = currentUser
  const fullStoryData = { karma, afKarma, frontpagePostCount, voteCount, createdAt }
  global.FS.identify(currentUser._id, {
    displayName: currentUser.displayName,
    email: currentUser.email,
    // Custom LessWrong variables
    ...fullStoryData
  });
}
<commit_msg>Hide displaynames by default<commit_after>import { getSetting } from 'meteor/vulcan:core';
import { addInitFunction, addIdentifyFunction } from 'meteor/vulcan:events';

function googleTagManagerInit() {
  const googleTagManagerId = getSetting('googleTagManager.apiKey')
  if (googleTagManagerId) {
    (function (w, d, s, l, i) {
    w[l] = w[l] || []; w[l].push({
      'gtm.start':
        new Date().getTime(), event: 'gtm.js'
    }); var f = d.getElementsByTagName(s)[0],
      j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; 
      j.async = true; 
      j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;         
      f.parentNode.insertBefore(j, f);
    })(window, document, 'script', 'dataLayer', googleTagManagerId)
  }
}

addInitFunction(googleTagManagerInit)

const identifyFullStoryUser = (currentUser) => {
  const { karma = 0, afKarma = 0, frontpagePostCount = 0, voteCount = 0, createdAt, username, displayName: lWDisplayName } = currentUser
  const fullStoryData = { karma, afKarma, frontpagePostCount, voteCount, createdAt, username, lWDisplayName }
  global.FS.identify(currentUser._id, {
    // Don't show user display names by default
    displayName: currentUser._id,
    email: currentUser.email,
    // Custom LessWrong variables
    ...fullStoryData
  });
}

{'fraction_non_alphanumeric': 0.14912280701754385, 'fraction_numerical': 0.003987240829346092, 'mean_word_length': 3.725047080979284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6516693', 'n_tokens_mistral': 869, 'n_tokens_neox': 839, 'n_words': 183}