Overview

This document provides a step-by-step guide on using the enhanced beacon service to send identifies and events securely with strict type assertions for enhanced data quality.

Enabling the Feature

This feature is enabled by default for all clients using the beacon service. No additional configuration is required on the server side.

Client-Side Steps

To utilize these capabilities, you will need to follow the methods described below to send identifies and events utilizing a Tag Manager such as GTM or utilizing Javascript within your platform. For more information on Hum’s DataLayer events, please find our documentation here.

meta fields will, by default, not have an assigned field on user’s profile. Please discuss with your CSX team what fields you would like to send and the usecase that they will support and the Hum team will wire that piece up for you.

Identifying Users by Email

Method: identifyUserByEmail(email: string, meta?: object)

This method allows you to identify a user by their email.

Parameters:
  • email: (required) A string representing the email address of the user.
  • meta: (optional) An object containing additional metadata about the user.
Usage Steps:
  1. Ensure the email parameter is a string.
  2. If you provide the meta parameter, ensure it is an object.
  3. Call the method with the appropriate parameters.
Example:
beaconService.identifyUserByEmail('user@example.com', { age: 28, location: 'NYC' });

Identifying Users by Secondary ID

Method: identifyUserBySecondaryId(systemName: string, id: string, meta?: object)

This method allows you to identify a user by a secondary ID such as a username or customer ID.

Parameters:
  • systemName: (required) A string representing the name of the system where the ID is used.
    • It is important that this matches the source field that is matching your backend datasync such as mailchimp or marketo
  • id: (required) A string representing the secondary ID of the user.
    • This should be the user’s id in the source system
  • meta: (optional) An object containing additional metadata about the user.
Usage Steps:
  1. Ensure both systemName and id parameters are strings.
  2. If you provide the meta parameter, ensure it is an object.
  3. Call the method with the appropriate parameters.
Example:
beaconService.identifyUserBySecondaryId('crm', '12345', { age: 28, location: 'NYC' });

Sending On-Page Behavior

Method: sendOnPageBehavior(behaviorName: string, meta?: object)

This method allows you to send information about user behavior on the page.

Parameters:
  • behaviorName: (required) A string representing the name of the behavior.
  • meta: (optional) An object containing additional metadata about the behavior.
Usage Steps:
  1. Ensure the behaviorName parameter is a string.
  2. If you provide the meta parameter, ensure it is an object.
  3. Call the method with the appropriate parameters.
Example:
beaconService.sendOnPageBehavior('clickButton', { buttonId: 'submit', page: 'home' });

Updating Profile Metadata

Method: updateProfileMetadata(source: string, meta: object)

This method allows you to update the profile metadata of a user.

Parameters:
  • source: (required) A string representing the source of the metadata.
  • meta: (required) An object containing the metadata to be updated.
Usage Steps:
  1. Ensure the source parameter is a string.
  2. Ensure the meta parameter is an object.
  3. Ensure the method does not send a content id.
  4. Call the method with the appropriate parameters.
Example:
beaconService.updateProfileMetadata('userForm', { age: 28, preferences: ['sports'] })