Overview

As a website admin using Hum, you have the ability to subscribe to dataLayer events which notify you of significant changes or actions that Hum undertakes. This allows you to dynamically program your site to respond to these occurrences in real-time.

Events and Their Payloads

Hum posts specific structured events to the dataLayer under particular circumstances. Below are the events, descriptions, and their corresponding payloads.

1. hum_ad_personalization_update

This event is triggered whenever Ad Settings are updated. It communicates changes in ad targeting settings.

Payload Structure:

{ "event": "hum_ad_personalization_update", 
   "targeting": { "ad_key_1": ["ad_key_1_val_1"], 
                  "ad_key_2": ["ad_key_2_val_1"] } 
}

Notes:

  • The targeting parameter comes from ongoing ad campaigns and is stored in local storage under the key hum_cra_ad_personalization.

2. hum_beacon_ready

This event occurs when the beacon (a critical tracking tool) has been successfully initialized and is ready for use.

Payload Structure:


{ "event": "hum_beacon_ready" }

3. hum_user_identified

This event fires when a user is identified either through a form or a secondary ID system.

Payload Structure:


{ "event": "hum_user_identified",
   "identified_by": "form|secondary_id",
       "email": "xxx@yyy.zzz" | "none",
       "secondary_id": "<secondary_system_source_name>_<secondary_system_id>" | "none"
}

4. hum_user_behavior

This event captures and logs different user behaviors on the site.

Payload Structure:

{ "event": "hum_user_behavior", "behavior_name": "pageview|post_read_start|..." }

Note:

You can trigger on all hum_user_behavior events except for those involving identification.

Implementation Steps

Step 1: Setting Up Google Tag Manager (GTM) Tags

To test and ensure these events are functioning correctly, you can create new GTM tags for each event. Follow the instructions below to set up the tags:

  1. Login to GTM Account:
    • Navigate to your Google Tag Manager account and select the container relevant to your site.
  2. Create a New Tag:
    • Click on “Tags” in the left-hand sidebar.
    • Click “New” and give your Tag a relevant name, such as “Hum Ad Personalization Update”.
  3. Configure Tag:
    • Click on “Tag Configuration”.
    • Choose “Custom Event”.
  4. Define Event Name:
    • For the hum_ad_personalization_update event, enter hum_ad_personalization_update in the event name field.
  5. Set Up Trigger:
    • Click on “Triggering”.
    • Select “New” and name the Trigger accordingly, e.g., “Trigger Ad Personalization Update”.
    • Choose “Custom Event” as the trigger type.
    • Enter the event name hum_ad_personalization_update.
  6. Save and Publish:
    • Save the trigger, and then the tag.
    • Publish your container.

Repeat these steps to create and configure tags and triggers for the other events (hum_beacon_readyhum_user_identifiedhum_user_behavior).

Step 2: Monitoring Events

Once the GTM tags are set up, you can monitor the dataLayer to see when events are posted. You can use browser developer tools for real-time tracking or set up cloud-based logging via Google Analytics or another analytics service.

Conclusion

By subscribing to Hum’s dataLayer events, you can enhance the dynamic capabilities of your site, responding intelligently to user interactions and system updates. Ensure to test each of the events thoroughly using GTM to confirm they are firing as expected.