Stamp Account attributeUpdated 30/04/2019


Takes the value of a user Event to write it at the account level. Any user in the account, when they perform "my_event" will update the value at the account level


// Loop over each event in this batch
events.map(e => {
  // If the right even happens
  if (e.event === "my_event"){
    const { my_property } = e.properties;
    // Set a trait on the Account for the current User
    hull.account({
      // This "links" the user to the account identified
      // by `user.domain`.
      // remove this line if you don't want to change
      // any pre-existing user-account link.
      // If you want to keep the pre-existing user-account link,
      // write `hull.account().traits({...})`
      domain: user.domain 
    }).traits({
      my_attribute: my_property
    })
  }
});