Count Matching entriesUpdated 30/04/2019


We want to find the account expansion potential quickly.

Count technologies in Datanyze Technologies array which match our existing public connectors.

Return as a new integer property: matching_technologies


const matchingTechs = [
  'HubSpot',
  'Segment.io',
  'Facebook Web Custom Audiences',
  'Salesforce',
  'Salesforce CRM',
  'MailChimp',
  'Optimizely',
  'Instagram',
  'Intercom',
  'PostgreSQL',
  'MySQL',
  'Zapier',
  'Clearbit',
  'Slack'
];

const { matching_technologies, datanyze = {} } = user;
const { technologies } = datanyze;
const techsChanged = _.has(changes, 'user.datanyze.technologies');

if (
  technologies !== undefined &&
  (techsChanged || matching_technologies === undefined)
) {
  const count = _.intersection(technologies, matchingTechs).length;
  hull.traits({ matching_technologies: count });
}