How to use the segmentio-facade.Identify function in segmentio-facade

To help you get started, we’ve selected a few segmentio-facade examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github segmentio / analytics.js-core / lib / analytics.js View on Github external
// clone traits before we manipulate so we don't do anything uncouth, and take
  // from `user` so that we carryover anonymous traits
  user.identify(id, traits);

  var msg = this.normalize({
    options: options,
    traits: user.traits(),
    userId: user.id()
  });

  // Add the initialize integrations so the server-side ones can be disabled too
  if (this.options.integrations) {
    defaults(msg.integrations, this.options.integrations);
  }

  this._invoke('identify', new Identify(msg));

  // emit
  this.emit('identify', id, traits, options);
  this._callback(fn);
  return this;
};
github segmentio / analytics.js-integrations / integrations / hubspot / lib / index.js View on Github external
HubSpot.prototype.identify = function(identify) {
  // use newer version of Identify to have access to `companyName`
  var newIdentify = new Identify({
    traits: identify.traits(),
    userId: identify.userId()
  });

  if (!newIdentify.email()) {
    return;
  }

  var traits = newIdentify.traits({
    firstName: 'firstname',
    lastName: 'lastname'
  });
  traits = convertDates(traits);
  traits = formatTraits(traits);

  if (newIdentify.companyName() !== undefined) {
github segmentio / analytics.js-integrations / integrations / rockerbox / lib / index.js View on Github external
function email(user) {
  var identify = new Identify({ userId: user.id(), traits: user.traits() });
  return identify.email();
}

segmentio-facade

Providing common fields for analytics integrations

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages