Developer Solutions - Tealium https://tealium.com/developer-center/ Customer Data Hub | Customer Data Platform and Tag Management Wed, 09 Jul 2025 19:55:30 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.1 HIPAA-Compliant Data Management in Web Analytics https://tealium.com/developer-center/hipaa-compliant-data-management-in-web-analytics Mon, 07 Jul 2025 21:29:42 +0000 https://tealium.com/?p=84694 Overview In the highly regulated world of healthcare, organizations must adhere to Office for Civil Rights (OCR) guidelines outlined in the HIPAA Privacy and Security Rules, making secure, controlled data management not optional, but mission-critical. However, browser environments are not inherently HIPAA-compliant. As a result, it falls to your internal teams to define how data […]

The post HIPAA-Compliant Data Management in Web Analytics appeared first on Tealium.

]]>
Overview

In the highly regulated world of healthcare, organizations must adhere to Office for Civil Rights (OCR) guidelines outlined in the HIPAA Privacy and Security Rules, making secure, controlled data management not optional, but mission-critical. However, browser environments are not inherently HIPAA-compliant. As a result, it falls to your internal teams to define how data should be collected, processed, and shared to ensure compliance. That includes ensuring no PII or PHI is passed to downstream platforms that are not HIPAA compliant because they will not sign a Business Associate Agreement (BAA).

Tealium frequently supports healthcare organizations navigating this exact challenge. Many discover that data is being collected in a non-HIPAA-compliant manner, such as sending raw search terms, which may qualify as PHI, to analytics tools that won’t sign a BAA. For example, if a user visits your site and searches for “cancer centers,” the search term itself could be considered PHI. While most analytics platforms want to log both the search event and the search term, they can’t legally store that type of data without a BAA.

That’s where Tealium steps in. Tealium can identify search events and inspect explicitly declared data layer variables, like search_term, to generate a hashed version of the data. This hashed value can be passed downstream to non-HIPAA-compliant analytics tools so that trend analysis can still occur. From a compliance perspective, this is a win: the analytics vendor only receives the hash. From a marketer’s perspective, however, the hash itself isn’t human-readable or actionable.

To solve for this need, Tealium can also send the full data layer payload – including both the original and hashed values – to your 1st-party data warehouse. Because your organization owns and secures this environment, storing PHI here aligns with HIPAA compliance. From there, you can build a lookup table that maps hashed values to their original terms. This lookup can be referenced alongside reports from your non-HIPAA-compliant analytics platform, enabling your team to interpret trends without exposing raw PHI to vendors.

Tealium Products required to support this use case:

  • For Data Processing
  • For Data Storage, either
    • EventStream to stream to your data lake/warehouse, or
    • EventStore to temporarily store the data on your behalf

Steps to Deploy

  1. Data Processing
    1. Define your Data Layer attribute that contains the search term, e.g. search_term
    2. Create a new Data Layer attribute that will hold your new hashed search term, e.g. search_term_hashed
    3. Create a ‘Set Data Values’ Extension that sets the value of search_term_hashed to match search_term prior to hashing.
    4. Create a new Crypto Extension that applies the SHA256 hashing algorithm to search_term_hashed
    5. Map the search_term_hashed variable to your analytics vendor, e.g. to s.prop42
  2. Data Storage
    1. Within EventStream, create a new Event Feed with conditional logic that search_term_hashed is assigned
    2. Stream to your data lake/warehouse
      1. Configure a new Big Data Connector to pass the data to your data lake/warehouse
    3. Temporarily store within Tealium
      1. Within the Event Feed window, slide the “Event Data Storage” slider to “EventStore”

Example 3rd-Party Analytics Report (Using Hashed Search Terms)

search_term_hashed search_count
52cfaeabb3806a9223f5c74365e58943bfd348d9ca74815fc05d15e3fbfb346f 6
20922be582691ee25328eedd42d2d3678a125c260d32064d909a0c353de88df9 3
c851687980a4219de7f1473d79b58f3a0d7132ccfcf47abdac45e22addf3f8f2 1

 

Sample Company Table of Stored Search Terms

search_term search_term_hashed event_id event_timestamp
mental health 52cfaeabb3806a9223f5c74365e58943bfd348d9ca74815fc05d15e3fbfb346f 976829a7-aede-4691-9298-10ce3b0e4508 5/7/25 10:19
mental health 52cfaeabb3806a9223f5c74365e58943bfd348d9ca74815fc05d15e3fbfb346f 55ff1a57-d5a3-4049-82ae-7cdc70f2057e 5/7/25 14:51
cancer centers c851687980a4219de7f1473d79b58f3a0d7132ccfcf47abdac45e22addf3f8f2 fb0de3e7-818f-4909-b9a6-af2636b2281d 5/7/25 10:10
cancer screening 20922be582691ee25328eedd42d2d3678a125c260d32064d909a0c353de88df9 4f042c93-5771-458d-b909-e14180e17b2b 5/7/25 13:59
mental health 52cfaeabb3806a9223f5c74365e58943bfd348d9ca74815fc05d15e3fbfb346f eed1a971-1f3d-4ad8-90c4-f7e943cbd38d 5/7/25 15:22
mental health 52cfaeabb3806a9223f5c74365e58943bfd348d9ca74815fc05d15e3fbfb346f 3cfbb1fe-6575-456c-95d2-a27f1d84d505 5/7/25 15:41
cancer screening 20922be582691ee25328eedd42d2d3678a125c260d32064d909a0c353de88df9 bdf88281-a62d-4926-800d-a383cde3e1e0 5/7/25 13:20
mental health 52cfaeabb3806a9223f5c74365e58943bfd348d9ca74815fc05d15e3fbfb346f b0513d36-de27-47cd-91bf-0a934ff24e65 5/7/25 6:40
cancer centers c851687980a4219de7f1473d79b58f3a0d7132ccfcf47abdac45e22addf3f8f2 33edfc6a-9227-4760-a12d-fc45409a961a 5/7/25 16:37
mental health 52cfaeabb3806a9223f5c74365e58943bfd348d9ca74815fc05d15e3fbfb346f b065398e-23ff-466e-984c-883eb4064652 5/7/25 12:37

 

Query to pull distinct search_term values and their associated hashed values

SELECT DISTINCT search_term, search_term_hashed FROM search_events;

search_term search_term_hashed
mental health 52cfaeabb3806a9223f5c74365e58943bfd348d9ca74815fc05d15e3fbfb346f
cancer centers c851687980a4219de7f1473d79b58f3a0d7132ccfcf47abdac45e22addf3f8f2
cancer screening 20922be582691ee25328eedd42d2d3678a125c260d32064d909a0c353de88df9

 

You now have both the unique data parameters in your own data set and the aggregated trends in your analytics tool. This makes it easy to cross-reference and understand user behavior.

By decoupling sensitive data from your analytics workflows, you can maintain marketing agility without compromising on compliance. Tealium provides the tools and expertise to ensure both objectives are met securely, effectively, and in alignment with HIPAA requirements.

Want help implementing this securely in your environment? Reach out to your Tealium representative or visit Tealium for Healthcare.

 

 

 

The post HIPAA-Compliant Data Management in Web Analytics appeared first on Tealium.

]]>
Real-Time Serverless Data Transformations: PII Detection and Hashing https://tealium.com/developer-center/real-time-serverless-data-transformations-pii-detection-and-hashing Mon, 07 Jul 2025 21:09:48 +0000 https://tealium.com/?post_type=solution&p=85017 Modern data platforms, such as Tealium, enable developers to manipulate event data on the fly as it streams through the system. Tealium Functions provide this important capability to developers via a serverless environment where user-defined JavaScript code can be run to transform, clean, and enrich incoming data in real time. Because Tealium functions are serverless, […]

The post Real-Time Serverless Data Transformations: PII Detection and Hashing appeared first on Tealium.

]]>
Modern data platforms, such as Tealium, enable developers to manipulate event data on the fly as it streams through the system. Tealium Functions provide this important capability to developers via a serverless environment where user-defined JavaScript code can be run to transform, clean, and enrich incoming data in real time. Because Tealium functions are serverless, you don’t need to set up your own server, you can inject custom logic directly into Tealium’s intelligent data pipeline. This unlocks flexibility for data handling while Tealium takes care of the infrastructure, scaling, and low-latency execution.

Some key benefits of using Tealium Functions include:

  • Serverless execution: Your code runs on Tealium’s infrastructure, so no servers to manage or deploy.
  • Real-time processing: Transformations occur immediately as data is collected, not hours later in a batch job.
  • Flexibility: You can write custom JavaScript to meet any data requirement or business rule.
  • Scalability: The function will automatically scale to handle high event volumes without performance tuning on your part.
  • Cost-efficient: Transformation and data wrangling without the compute cost. 

Common use cases for Tealium Functions range from simple data cleanup to complex routing logic. For example, you can perform data normalization and enrichment, mask or anonymize PII (personally identifiable information), reformat data to standard conventions, filter or route events based on conditions, or even compute custom metrics on the fly. Essentially, if you have a custom rule or transformation that should happen to every incoming event (or to specific events), Tealium Functions might be a good way to handle it.

Types of Tealium Functions

Tealium currently supports three different types of Functions: Data Transformation Functions, Event Functions, and Visitor Functions. The table below compares each:

Function Type Maximum Execution Time Async Support (fetch/await) Description & Pipeline Stage
Data Transformation Function (EventStream pre-processing) 150 ms per invocation  No (not intended for async calls due to the short 150 ms limit) Triggered after an event is collected from a data source but before it is processed by Tealium​. Used for quick, synchronous modifications to incoming event data. 
Event Function (EventStream post-processing) 10 s per invocation  Yes (supports async operations such as HTTP calls) Triggered after an event is processed in EventStream (once Tealium has applied all event-level rules and enrichments)​. Runs on a per-event basis (requires EventStream). 
Visitor Function (AudienceStream post-processing) 10 s per invocation  Yes (supports async operations such as HTTP calls) Triggered after a visitor profile is processed (i.e. after an event’s data has been applied to the AudienceStream visitor and the profile is persisted)​. Runs in the AudienceStream CDP context (requires AudienceStream enabled) and executes once per visitor update. 

 

In this article, we will focus on Data Transformation Functions, which execute in real time immediately after an event is collected and before it is processed further. This makes them ideal for tasks like validating or modifying incoming event data, removing or hashing sensitive information, flattening nested structures, etc., right as the data enters the system. By handling it at ingestion time, you ensure that all downstream systems only see cleaned or anonymized data. This reduces risk and saves you from doing additional processing later. In fact, it’s considered best practice that any user identifiers containing PII (like emails or phone numbers) be hashed or obfuscated before they are used elsewhere, to protect user privacy. 

How Tealium’s Data Pipeline Works (and Where Functions Fit)

Tealium’s event data pipeline can be summarized in three stages:

  1. Data Collection: Data is collected from various sources (web, mobile, servers, etc.) and sent to Tealium. This is the entry point – for instance, via Tealium Collect API or Tag Manager – where raw events arrive with their payload (often referred to as the event’s data layer or UDO, Universal Data Object).
  2. Transformation: The incoming event data is then processed within Tealium. This is where Functions execute, applying any custom JavaScript transformations or enrichments you’ve defined. It’s the core real-time processing step where data can be modified, filtered, or augmented on the fly.
  3. Data Activation: Finally, the (now transformed) data is passed along to various outputs: it could be stored or used to update user profiles, and is forwarded to downstream tools via connectors (APIs, email marketing, analytics, etc.) for real-time action or analysis.

Figure 1. A simplified Tealium Data Pipeline. 

In the above diagram, the green node indicates where a Data Transformation Function would fire during the event’s journey. Because the function runs so early in the pipeline, any changes it makes (such as masking a piece of data) will persist through the rest of the flow. Downstream systems and even Tealium’s own AudienceStream attributes will only see the modified values.

To summarize, Tealium Functions allow you to inject custom code into the server-side stream of data. This serverless approach means you get the power of real-time data handling (similar to writing code in a microservice or cloud function) but managed entirely within Tealium’s interface. Now, let’s look at a concrete example to make this more tangible.

Use Case: Detecting and Hashing PII (Email Addresses)

One common requirement is to prevent sensitive personal data from flowing through systems in plain text. For instance, you might want to detect any email addresses coming in as part of event data and replace them with a hashed value. Hashing is a one-way encryption that converts the email into an irreversible string (often using SHA-256 or similar algorithms). This protects user privacy while still allowing you to use the hashed value as an identifier for matching purposes (since the same email will always hash to the same string) (Best practices for selecting user identifiers | Guides | Tealium Docs).

In our scenario, we’ll create a Tealium Function that scans each incoming event for any values that look like email addresses. If found, it will replace those values with a SHA-256 hash. We’ll also set a flag in the event data to mark that potential PII was detected (which could be useful for auditing or conditional logic in connectors). We want this to happen in real time, before the data is stored or sent out of Tealium.

To achieve this, we’ll use a Data Transformation Function with a custom trigger condition and a bit of JavaScript code:

  • Trigger Condition: “If any field in the event data looks like an email address.” We can define this using a JSONPath selector and a regex (regular expression) pattern to match email strings.
  • Action (Function Code): Hash those email fields using a cryptographic hash (SHA-256) and mark the event accordingly.

Below, we’ll walk through setting up this function step by step.

Implementation: Building the Email-Hashing Function in Tealium

Follow these steps in your Tealium server-side Functions UI to create and test the PII hashing function:

  1. Create a new Function: In Tealium’s Customer Data Hub interface, navigate to Server-Side > Functions and click on + Add Function. This will start the setup for a new server-side function.
  2. Choose function type and name: When prompted, select Data Transformation as the function type (since we want to transform incoming event data). Give the function a descriptive name, e.g., “Email Hashing”. (You can use the same name for the function’s trigger as well for clarity.)
  3. Define the trigger rule: After clicking Continue, you’ll configure a custom trigger condition for when this function should run. In the Trigger Name, enter something like “PII Email Detection” (or reuse the function name). For the condition: set the Selector to $.data – this JSONPath points to the entire event data object (Create a function | Manage functions | Tealium Docs). Then choose the operator “matches regex” and enter a regex pattern that matches email addresses. For example, use:
/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/im
  1. This pattern will match typical email formats (user@domain.tld). Essentially, it looks for a string containing @ and a “dot” with valid characters around them. By setting the selector to the root of the data, this condition will be true if any field in the event data matches the regex. (Under the hood, Tealium will evaluate this regex against a string representation of the event data or its fields.)

    Figure: Configuring the custom trigger in Tealium’s Functions UI. Here, the selector is $.data and the operator is “matches regex” with an email pattern, meaning the function will trigger for events containing an email address in any field.
  2. Proceed to code editor: Once your condition is set up, click Continue. Tealium will create the function and take you to the Code tab where you can write the JavaScript logic. (By default, some sample code or comments may be present — you can remove those.)
  3. Write the transformation code: Copy and paste the following code into the function’s code editor:
import CryptoES from "crypto-es";

// If needed, specify any keys that should be exempt from hashing (whitelist)
const allowedPIIKeys = ["mid_email"]; // e.g., keys that you consider already safe or hashed

function findAndHashEmailKeys(jsonData, hashFunction) {
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; // simple regex to validate an email string

  function traverse(obj) {
    if (typeof obj === "object" && obj !== null) {
      for (const key in obj) {
        const value = obj[key];
        if (
          typeof value === "string" &&
          emailRegex.test(value) &&
          !allowedPIIKeys.includes(key)
        ) {
          // Found a string that looks like an email and is not in the allowed list
          obj[key] = hashFunction(value).toString();
        } else if (typeof value === "object") {
          // Recurse into nested objects/arrays
          traverse(value);
        }
      }
    }
  }

  traverse(jsonData);
}

// The main transform function provided by Tealium - this runs for each event
transform((event) => {
  // Apply our email-hashing function to the event's data object (UDO)
  findAndHashEmailKeys(event.data.udo, CryptoES.SHA256);

  // (Optional) Log the transformed event data for debugging
  console.log(JSON.stringify(event.data));
  // console.log(JSON.stringify(event, null, 2)); // pretty-print, if needed

  // Set a flag in the event indicating PII was detected (and handled)
  event.data.udo["potential_pii_detected"] = true;
});
  1. Let’s break down what this code does:
    • We import the crypto-es library (available in the Functions environment) to use its SHA-256 hashing (CryptoES.SHA256).
    • We define an array allowedPIIKeys. This is a whitelist of field names that we will not hash even if they match the regex. In this example, [“mid_email”] is listed – imagine this is a field that may contain an email but we intentionally allow it (perhaps it’s already hashed or it’s needed in raw form). You can adjust or leave this list empty as needed.
    • The function findAndHashEmailKeys(jsonData, hashFunction) is our recursive scanner. It takes an object (jsonData) and a hashing function. Inside, it uses emailRegex (a simpler regex ^[^\s@]+@[^\s@]+\.[^\s@]+$ to validate an email string exactly) to test values.
    • The traverse(obj) inner function walks through the object. For each key/value:
      • If the value is a string and matches the email pattern, and the key is not in the allowed list, we replace obj[key] with the hashed version of the string. We use hashFunction(value).toString() – given our call will pass CryptoES.SHA256, this produces a SHA-256 hash of the string.
      • If the value is an object (or array), we recursively call traverse on it to check nested fields.
    • After defining this, we call traverse(jsonData) on the provided data object.
    • Finally, in the Tealium-provided transform((event) => { … }) callback, we execute our function on event.data.udo. In Tealium, event.data.udo is where the event’s custom data layer lives (the key-value pairs sent from the source). By passing CryptoES.SHA256 as the hashFunction, our code will hash any detected email values.
    • We log the event.data to the console for debugging (this output can be viewed in the function test logs). We also set event.data.udo[“potential_pii_detected”] = true unconditionally, assuming that if the function ran, we found PII. (You could make this conditional inside findAndHashEmailKeys if you wanted to flag only when a hash replacement occurred.)
    • The end result: any email addresses in the event’s UDO should now be replaced by a 64-character SHA-256 hash string, and a flag is set in the data.
  2. Test the function: It’s important to verify our function works as expected. Tealium provides a built-in Test tab for functions. Switch to the Test view in the function editor. Here you can input a sample event payload JSON. For example, use a payload where some fields contain an email address, e.g.:
/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/im
  1. In this sample, customer_email should be hashed by our function (since it looks like an email and is not whitelisted), but mid_email should remain unchanged (since we whitelisted that key). Run the test (click Run Test). In the output, inspect event.data.udo: you should see the customer_email value now replaced with a long hexadecimal string (the SHA-256 hash), mid_email still showing the original, and potential_pii_detected: true added. You should also see the console log output with the transformed JSON. If something isn’t working, use the logs to debug (for instance, ensure your JSONPath selector and regex in the trigger match the test payload so that the function is actually fired). For more details on testing functions, see Tealium’s Test Functions documentation.
  2. Enable and deploy: Once testing looks good, go to the Configuration tab of the function. Set the Status to ON (by default, new functions might be created as off or in testing mode). Click Done to confirm. Now, Save and Publish your changes (the publish step pushes the function live in the environment). After publishing, the function becomes active in your event pipeline – any new incoming events that meet the trigger condition will now invoke your code. (Be aware it may take a couple of minutes after publishing for the function to fully propagate and begin executing on incoming data (Create a function | Manage functions | Tealium Docs).)

That’s it! You have deployed a serverless data transformation that detects email addresses in real time and hashes them. You can monitor the function’s execution via Tealium’s function logs or observe the outgoing data to confirm the emails are hashed.

What’s Next?

At this point, we’ve demonstrated how Tealium Functions can be used to enforce privacy by anonymizing PII on the fly. This same pattern can be extended to other forms of sensitive data (phone numbers, credit card numbers, etc.) by adjusting the regex and using the appropriate hashing or masking logic. You might also consider using Functions for tasks like validating data formats, rejecting events that don’t meet certain criteria, or enriching events with computed fields (e.g., categorizing a free-text field into a taxonomy).

For further reading, check out the official Tealium documentation on Data Transformation Functions to understand more about their capabilities and limitations (for example, execution time limits). You may also explore Tealium’s Developer blog for articles on real-time data processing – the concepts of Events, Functions, and Attributes working together. And if you’re interested in more advanced use cases, Tealium’s Functions can even call external APIs or perform async tasks (with some considerations on execution time).

By leveraging Tealium Functions, you can support a range of different use cases including as we have shown here ensuring that your data is clean, privacy-compliant, and tailored to your needs before it’s activated in downstream systems. This leads to safer data practices and sets the stage for more powerful real-time data applications.

The post Real-Time Serverless Data Transformations: PII Detection and Hashing appeared first on Tealium.

]]>
Getting Started with Tealium iQ Tag Management https://tealium.com/developer-center/getting-started-with-tealium-iq-tag-management Mon, 07 Jul 2025 20:22:35 +0000 https://tealium.com/?post_type=solution&p=85007 The Issue & Solution The ever-growing number of client-side tags poses issues such as risky code updates, inconsistent data, the need for a developer resource to update code, and many others. Our solution to these issues is Tealium iQ Tag Management (TiQ). Tealium’s tag management solution follows many industry-level tag management features, with the most […]

The post Getting Started with Tealium iQ Tag Management appeared first on Tealium.

]]>
The Issue & Solution

The ever-growing number of client-side tags poses issues such as risky code updates, inconsistent data, the need for a developer resource to update code, and many others. Our solution to these issues is Tealium iQ Tag Management (TiQ).

Tealium’s tag management solution follows many industry-level tag management features, with the most distinguishing and valuable features being Extensions and Consent Integrations. TiQ extensions allow users to easily manipulate the data layer, vendor tags, and your site directly from TiQ. These features not only help to optimize your tag setup but also allow users to resolve data inconsistencies before sending to 3rd-party vendors.  

Getting Started

There are two key items you will need to get started with TiQ. 

You will need:

  1. Tealium Universal Data Object (UDO): utag_data object
  2. Tealium Library: utag.js script

Universal Data Object (UDO): utag_data

The Universal Data Object, also known as the UDO object, is Tealium’s universal data layer. The data layer is what drives Tealium by triggering events and tags. The data layer will need to be initialized and populated onto your site as the utag_data object. It is important to ensure the utag_data object is created and populated before the Tealium library runs.

Tealium Library: utag.js

Next, you will need to run Tealium’s library by loading the utag.js script onto your site. This script should come after the utag_data object, and it is recommended to place the script on all pages near the top of the opening <body> tag.

To find your utag.js script, navigate to the Manage Environments in your profile by following the steps here.

Essentially, you are done, and TiQ will be running on your site! The next step is to add data layer variables within your Tealium profile and add tags from the Tealium Marketplace to load onto your site. 

Adding Tealium Data Layer Variables

Within your Tealium profile, there is a page for the Data Layer. The Tealium Data Layer is essentially a container for each utag_data value. The data layer variable is named the same as the tag_data key, and the value is stored within the data layer container. Each variable that you implement in the utag_data object must also be created here so that it can be used in your configuration. The variables must be named exactly as they appear in the utag_data object.

For example, if the utag_data object includes a key value pair for ‘page_name’: ’Home’, the ‘page_name’ variable will need to be created within your profile’s data layer to contain and pass along the value of ‘Home’ to your tags.

Setting Up Tags

Next, you can add tags to your site. Tealium has over a thousand tags within the Tag Marketplace, which provide a simple, user-friendly interface to add your tag-specific configurations. You can do this by simply navigating to Tags > + New Tag > and searching for your desired tag within the Marketplace. 

Next, you will follow the interface to add your tag configurations, set any Load Rules for when the tag should load, and map any data layer variables to pass along UDO variable values to the tags. 

Creating Extensions

The main feature that differentiates Tealium’s Tag Manager from other tag managers is the Extension feature. Tealium offers many extension options that allow you to dynamically set tag configurations, manipulate, normalize, and set data layer values, add JavaScript to your site, and much more. 

You can use this feature by navigating to Extensions > + Add Extension and viewing the many extension options available.

Enforcing Consent: Consent Integration

Lastly, Tealium offers a simple and effective way to enforce consent for each tag through our Consent Integration option. Consent Integrations works seamlessly alongside your Consent Management Platforms. You can set up the consent preferences for each tag by navigating to Consent Integrations, completing the setup of your Purpose Groups, and then mapping each tag to a purpose group within the Map Tag screen.

To wrap up, Tealium offers a complete and robust approach to Tag Management. Our solution is not only simple to use but also allows you to take control of your data layer, tagging model, and consent enforcement, right at the center of your tag management solution. 

The post Getting Started with Tealium iQ Tag Management appeared first on Tealium.

]]>
Tealium Functions: Pharma Use Case https://tealium.com/developer-center/tealium-functions-pharma-use-case Fri, 27 Jun 2025 14:12:07 +0000 https://tealium.com/?post_type=solution&p=84687 Overview Tealium Functions is a powerful serverless environment that enables organizations to build and run lightweight, real-time JavaScript functions within the Tealium Customer Data Hub. These functions allow for in-the-moment event data manipulation, data augmentation, and outbound integrations—helping teams implement more sophisticated logic, faster than traditional platform configurations alone. Functions are especially useful for organizations […]

The post Tealium Functions: Pharma Use Case appeared first on Tealium.

]]>
Overview

Tealium Functions is a powerful serverless environment that enables organizations to build and run lightweight, real-time JavaScript functions within the Tealium Customer Data Hub.

These functions allow for in-the-moment event data manipulation, data augmentation, and outbound integrations—helping teams implement more sophisticated logic, faster than traditional platform configurations alone.

Functions are especially useful for organizations looking to:

  • Clean, enrich, or restructure data as it enters Tealium.
  • Send real-time data to third-party systems.
  • Apply custom transformations not supported natively in AudienceStream or EventStream.

This article provides an overview of Tealium Functions and showcases three real-world use cases tailored for the pharmaceutical industry.

Tealium Functions

Tealium Functions are written in ECMAScript 2020 (ES11) and run on a GraalVM-based environment directly within the Tealium platform. There are three core function types:

Function Type When It Executes Common Uses
Data Transformation After data is collected, before it is processed Flattening data, redacting PII, renaming or modifying variables
Event Function After an event is processed Enriching event data, sending real-time data to vendors
Visitor Function After a visitor is processed Augmenting visitor profiles, syncing with CRM or support tools

Each function is tied to a single trigger, and developers can test, monitor, and configure functions directly within the Tealium UI.

 

Use Case #1: Detect and Hash PII in Event Data for Compliant Activation

Goal: Identify and secure sensitive PII in inbound event data to support compliant activation across paid media platforms.

Challenge: In regulated industries like pharmaceuticals, inbound data may contain personally identifiable information (PII) that must be redacted, masked, or transformed before use in segmentation or outbound activation. While Tealium provides built-in mechanisms to handle known fields like email, dynamic or user-generated content may require automated PII detection.

Solution:

import flatten from 'tealium/util/flatten';
import { SHA256 } from 'crypto-es/lib/sha256.js';

const options = { delimiter: '_' };

transform(async (event) => {
  event.data.udo = flatten(event.data.udo, options);
  const udo = event.data.udo;

  if (udo.customer_email) {
    udo.customer_email = udo.customer_email.trim().toLowerCase();
  }

  const piiInput = JSON.stringify({ Text: JSON.stringify(udo), LanguageCode: 'en' });

  const response = await fetch("https://comprehend.us-east-1.amazonaws.com", {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-amz-json-1.1',
      'X-Amz-Target': 'Comprehend.DetectPiiEntities',
      'Authorization': 'Bearer YOUR_AWS_AUTH_TOKEN_HERE'
    },
    body: piiInput
  });

  const result = await response.json();

  if (result.Entities && Array.isArray(result.Entities)) {
    result.Entities.forEach(entity => {
      const piiField = Object.keys(udo).find(key =>
        udo[key] && udo[key].toLowerCase().includes(entity.Text.toLowerCase())
      );
      if (piiField) {
        udo[`${piiField}_sha256`] = SHA256(udo[piiField]).toString();
        delete udo[piiField];
      }
    });
  }

  if (udo.event) {
    delete Object.assign(udo, { ['tealium_event']: udo['event'] })['event'];
  }
});

Outcome: Any detected PII (e.g., name, phone number, email) is replaced with a hashed version, ensuring that downstream tools (e.g., Meta, Google, DSPs) only receive secure, anonymized identifiers. This use case supports privacy compliance (e.g., HIPAA, GDPR) while maintaining marketing effectiveness.

Applicable KPIs:

  • Reduction in data privacy risk
  • Increase in compliant addressable audience size

Use Case #2: HCP Engagement Alerts to Field Reps

Goal: Notify field reps when high-value healthcare professionals (HCPs) engage with key digital content.

Challenge: Commercial teams need timely alerts to follow up with HCPs engaging with branded or unbranded materials, but marketing systems often lack real-time outbound triggers.

Solution:

import { event } from 'tealium';

const isHCP = event.data.hcp_verified === true;
const engagementType = event.data.engagement_type;
const assetName = event.data.asset_title;

if (isHCP && engagementType === 'clinical_material_view') {
  const payload = {
    hcp_id: event.data.hcp_id,
    email: event.data.hcp_email,
    asset_title: assetName,
    timestamp: event.data.event_timestamp
  };

  fetch("https://crm.pharma-company.com/api/hcp-alert", {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(payload)
  });
}

Outcome: Field reps receive timely notifications that specific HCPs have engaged with high-priority materials – enabling more relevant and timely follow-up and improving sales effectiveness KPIs like “Next Best Action” engagement.

Applicable KPIs:

  • Increase in HCP follow-up within 24 hours
  • Higher CTRs on rep-triggered emails
  • Improved closed-loop marketing outcomes

Use Case #3: Patient Support Program (PSP) Eligibility Check and Profile Enrichment

Goal: Enrich patient profiles with PSP eligibility information at the moment of website registration.

Challenge: Eligibility for PSPs may depend on condition, insurance, or location. These lookups typically require API calls to backend systems and are not available in Tealium out of the box.

Solution:

import { visitor } from 'tealium';

const zip = visitor.data.zip_code;
const productId = visitor.data.product_interest;

fetch(`https://psp-api.pharma-company.com/eligibility?zip=${zip}&product=${productId}`)
  .then(response => response.json())
  .then(data => {
    visitor.data.psp_eligible = data.eligible;
    visitor.data.psp_offer_code = data.offer_code || null;
  })
  .catch(error => console.error('Eligibility check failed:', error));

Outcome: The visitor profile is enriched with eligibility status and offer codes, enabling real-time personalization, automated onboarding, or CRM handoff based on eligibility for support programs.

Applicable KPIs:

  • Increase in PSP enrollments via digital channels
  • Higher engagement and conversion rate on support program CTAs
  • Improved data quality for downstream patient journeys

Best Practices

  • Limit scope: Each function should perform a discrete task to stay within memory and time constraints.
  • Avoid external dependencies: Functions cannot use third-party libraries except approved platform-provided utilities like crypto-es.
  • Use flatten() wisely: Simplify nested payloads before processing.
  • Monitor performance: Use the Monitoring tab to track execution time, errors, and invocations.
  • Trigger functions strategically: Functions are triggered via custom rules; use consistent naming (e.g., tealium_event) for maintainability.

Summary

Tealium Functions provide pharmaceutical marketers and data teams with a flexible, compliant way to enrich data, personalize engagement, and connect to essential systems in real time. Whether you’re powering field rep alerts or supporting PSP enrollment, Functions reduce time to value and increase agility across the omnichannel journey.

For more detailed documentation, visit the Documentation pages on Functions or reach out to your Tealium representative to discuss specific use case implementations.

 

The post Tealium Functions: Pharma Use Case appeared first on Tealium.

]]>
Using Delayed Action Connectors in Tealium AudienceStream https://tealium.com/developer-center/using-delayed-action-connectors-in-tealium-audiencestream Thu, 29 May 2025 20:01:10 +0000 https://tealium.com/?post_type=solution&p=83544 Using Delayed Action Connectors in Tealium AudienceStream Overview Delayed Action Connectors in Tealium AudienceStream allow users to trigger events at specific time intervals after a visitor joins an audience. This feature is particularly useful for managing inactive visitors, triggering engagement campaigns, and automating time-based audience transitions. How It Works Data Flow in AudienceStream Understanding the […]

The post Using Delayed Action Connectors in Tealium AudienceStream appeared first on Tealium.

]]>

Using Delayed Action Connectors in Tealium AudienceStream

Overview

Delayed Action Connectors in Tealium AudienceStream allow users to trigger events at specific time intervals after a visitor joins an audience. This feature is particularly useful for managing inactive visitors, triggering engagement campaigns, and automating time-based audience transitions.

How It Works

Data Flow in AudienceStream

Understanding the basic order of operations and flow of data in AudienceStream is critical:

  1. Event Processing: When an inbound event is collected, it appears in Live Events and is processed.
  2. Visitor Enrichment: Event-level data is converted into visitor-level data.
  3. Visitor Stitching: If a visitor ID is detected and associated with an existing profile, the profiles are merged.
  4. Audience Evaluation: Business rules configured in AudienceStream are applied to determine audience membership.
  5. Connector Execution: Connector actions configured in AudienceStream are triggered.

Key Considerations

  • Event Requirement: AudienceStream does not update audience membership without an inbound event.
  • Visitor Profiles on Audience Removal: Removing a visitor from an audience does not delete the visitor profile.
  • Delayed Webhook Triggering: Webhook connectors using the Tealium Collect API can be set to fire events at a future date to update visitor profiles.

A delayed connector action in Tealium AudienceStream allows you to schedule an event or audience-triggered action to execute after a set period rather than immediately.

This is useful for scenarios requiring progressive engagement strategies—like purchase follow-up, subscription lifecycle management, etc.

Use Case: Managing Inactive Visitors

A common challenge is handling inactive visitors who no longer meet the criteria for their current audience but do not generate events that would trigger a visitor profile update.

Solution: Triggering Events via Webhooks

To transition visitors between audiences based on time, a connector can be configured to:

  • Send an event via the Tealium Collect API at a specified delay (e.g., 30 days after audience entry).
  • Update the visitor profile, triggering audience rules and badge updates.
  • Move the visitor into a new audience and/or remove them from an existing one.

Example: Subscription Lifecycle

  1. Day 0: A visitor subscribes to a newsletter.
  2. Day 30: A webhook triggers an event, updating the profile.
  3. Profile Update: The event triggers an Audience Rule that causes the visitor to lose the “New Subscriber” badge and move to a “Regular Subscriber” audience.
  4. Subsequent Actions: Further webhooks could be set up to trigger engagement campaigns or re-engagement emails at 60 and 90 days, as-needed.

Configuring Delayed Action Connectors

Steps to Set Up a Delayed Webhook Connector

  1. Navigate to Audience Connectors in Tealium AudienceStream.
  2. Select “Webhook Connector”
  3. Select Your Audience on which the delayed action should take place.
  4. Set Delay Timing:
    • Choose “End of Visit” as the trigger point.
    • Configure a 30-day delay before execution.
  5. Configure a POST request to the Tealium Collect API.
  6. Define the JSON Payload:
    {
      "tealium_account": "{{your_tealium_account}}",
      "tealium_profile": "{{your_tealium_profile}}",
      "tealium_event": "30_day_subscription_check",
      "customer_email": "{{email}}"
    }
    
  7. Save and Publish the AudienceStream profile.

Visitor Profile Stitching Considerations

  • A known identifier (e.g., email, customer ID) must be included in the webhook payload.
  • Anonymous visitors may not be eligible for delayed actions without a persistent identifier.

Advanced Use Cases

Progressive Audience Engagement

For scenarios requiring staged engagement:

  • Day 7: Send a product care guide.
  • Day 30: Offer a complementary product recommendation.
  • Day 60: Re-engagement offer if no further purchases.

Suppression and Retargeting

  • Immediately after purchase: Suppress retargeting ads.
  • After 60 days: Resume targeting for repurchase.

Summary

Delayed Action Connectors in Tealium AudienceStream provide powerful automation for audience transitions and engagement. By leveraging webhook triggers and delayed execution, businesses can optimize audience management, maintain data accuracy, and drive targeted marketing campaigns.

The post Using Delayed Action Connectors in Tealium AudienceStream appeared first on Tealium.

]]>
Get started with installing the Tealium data layer https://tealium.com/developer-center/get-started-with-installing-the-tealium-data-layer Wed, 14 May 2025 17:32:03 +0000 https://tealium.com/?post_type=solution&p=82957 The Tealium Data Layer is a flat, structured JavaScript object that centralizes the data on your website or app. Instead of relying on scattered, inline JavaScript or individual tags scraping the DOM, the Tealium Data Layer improves site performance, reduces long term dependency on developers, and ensures data consistency across platforms. Tealium’s data layer approach […]

The post Get started with installing the Tealium data layer appeared first on Tealium.

]]>
The Tealium Data Layer is a flat, structured JavaScript object that centralizes the data on your website or app. Instead of relying on scattered, inline JavaScript or individual tags scraping the DOM, the Tealium Data Layer improves site performance, reduces long term dependency on developers, and ensures data consistency across platforms.

Tealium’s data layer approach

A well constructed data layer should have the following qualities:

  • Foundational – The data layer should cover all important customer interactions.
  • Vendor Neutral – Use vendor neutral variable names like page_name as opposed eVar1.
  • Collaborative – Gather requirements from all parts of the organization, agencies, partners, etc. to make sure all use cases are covered.
  • Compliant – Ensure that you have legal approval to capture each variable in your data layer.

Components of the Tealium Data Layer

The Tealium Data Layer refers to both:

  • The global utag_data object, which holds persistent data for the page.
    • //Example utag_data object
      utag_data = {
          "tealium_event": "product_view",
          "page_name": "product_details",
          "site_section": "electronics",
          "user_id": "12345",
          "product_id": "SKU-9876"
      }
  • The dynamic objects passed to utag.view() and utag.link(), which provide contextual updates for tracking specific events. The utag.link method is used for tracking of non-pageload events, such as link clicks, form submits, or add to carts. The utag.view method tracks a page view, such as when rendering a new screen in a Single Page Application (SPA).
    • //Example utag.link call
      utag.link({
          "tealium_event": "button_click",
          "button_id": "subscribe_now",
          "user_role": "premium"
      })
      
      

Defining Requirements

Start by identifying all of the key interactions your customers will have with your website, mobile app, or connected device. These should be the most important activities that inform critical business decisions. These events will encompass everything from page views, form submissions, and searches to purchases or other conversions. 

Each event will contain contextual information called variables or event attributes. Your data layer specification is the combination of these key events and their corresponding attributes.

The Tealium team will assist in crafting the specification for your custom data layer. The variables in this specification will be defined by considering several sources, including:

  • Your marketing and analytics tagging requirements
  • Data to support any data driven use cases defined in the scope of the project
  • Common data points for your industry

Once all data points have been compiled, the Tealium team will provide your team with a data layer recommendation that contains the following:

  • A list of page and event types
  • Example data objects and tracking code to install.

Data Layer Impact

By implementing a well structured Tealium Data Layer, your data collection strategy will be scalable, efficient, and reliable. A properly defined data layer minimizes reliance on developers for ongoing tagging updates, reduces fragility associated with DOM scraping, and ensures data consistency across all marketing, analytics, and personalization platforms. With our expertise in crafting a tailored data layer specification, your team will have a clear roadmap for deploying and maintaining a future-proofed tracking solution that will be the foundation for your data strategy. 

 

Continued Learnings

For more details on Tealium components mentioned in this article:iQ Tag Management

The post Get started with installing the Tealium data layer appeared first on Tealium.

]]>
Enriching Customer Event Data with Transformer Models https://tealium.com/developer-center/enriching-customer-event-data-with-transformer-models Tue, 06 May 2025 20:00:11 +0000 https://tealium.com/?post_type=solution&p=82804 Overview In today’s data-driven landscape, understanding and reacting to customer behavior in real time is a competitive advantage. This article explores how Transformer architecture can be applied within the Tealium Customer Data Platform (CDP) to generate richer, more actionable event data. By combining AI-powered sequence modeling with Tealium’s real-time data capabilities, businesses can unlock advanced […]

The post Enriching Customer Event Data with Transformer Models appeared first on Tealium.

]]>
Overview

In today’s data-driven landscape, understanding and reacting to customer behavior in real time is a competitive advantage. This article explores how Transformer architecture can be applied within the Tealium Customer Data Platform (CDP) to generate richer, more actionable event data.

By combining AI-powered sequence modeling with Tealium’s real-time data capabilities, businesses can unlock advanced personalization, automated decision-making, and operational efficiency.

This article will help you:

  • Understand what makes transformers unique for customer event data.
  • Learn how transformers improve the quality and usability of event data.
  • Discover industry-specific use cases enabled by this approach.

The Power of Transformer Architecture for Event Data

Traditional models designed for sequential data often process events one step at a time, limiting their ability to capture patterns across long event sequences. In contrast, transformers analyze entire sequences holistically through mechanisms like self-attention and positional encoding, unlocking richer and more actionable event insights.

Transformer Features that Improve Event Data

Feature What it does Why it helps event data
Attention Mechanism Learns relationships between events across a customer’s event history Enables the model to determine which past events are most relevant when processing the current event (e.g., an abandoned cart from 3 sessions ago influencing today’s purchase)
Positional Encoding Retains event order without relying on recurrence Enables the model to recognize the correct order of events (e.g., distinguishing between product view → add to cart vs. add to cart → product view), which is essential for understanding customer behavior.
Parallelization Processes all events in parallel during training and serves event-level inference at runtime Enables scalable, real-time, and event-level inference when deployed within cloud environments.
Scalability Handles millions of users and events simultaneously Powers predictive models at enterprise scale by processing high-volume event streams outside Tealium infrastructure.

The result

Tealium customers can generate more intelligent, more contextual, and actionable event data — ready for downstream activation in AudienceStream or other destinations.

Examples

Retail: A retailer uses transformers to detect that a shopper who viewed high-margin items last week is now browsing lower-value products. This context triggers a timely promotion in AudienceStream — increasing the chances of retaining their high-value behavior.

Travel: A travel site uses transformers to detect that a user who previously searched for business flights is now browsing weekend getaways. AudienceStream uses this shift in behavior to trigger personalized recommendations for premium leisure packages — improving cross-sell opportunities.

Finance: A financial institution identifies a user who recently explored mortgage calculators and is now spending time on credit score pages. This signals early-stage intent, allowing AudienceStream to deliver targeted educational content and nurture the lead through the funnel.

Healthcare: A healthcare provider sees a user navigating from general wellness articles to treatment-specific pages across sessions. The model recognizes this shift and routes the user to a relevant care program, driving timely engagement through downstream activation channels.

Visualizing the Architecture

The following diagram illustrates how transformer models integrate with Tealium’s Customer Data Hub to enable event-level enrichment and real-time activation. Events are collected, preprocessed, enriched externally, and then activated seamlessly within AudienceStream.

 

Data Personalization Pipeline

Figure 1 – Real-time event-level enrichment pipeline integrating Transformer Models with Tealium’s Customer Data Hub. Events are ingested via EventStream, transformed via Functions, enriched externally through cloud-hosted Transformer Models, and activated in AudienceStream for real-time segmentation and personalized engagement.

From Features To Use Cases

The connection between the model’s features and business outcomes becomes clear when you consider how transformers can enrich event data:

  • Rather than relying solely on simple event counts or last-click attribution, transformers process each incoming event while contextualizing it with the customer’s historical behavior.
    Example: A customer may have browsed products, added them to their cart, and abandoned the purchase across multiple sessions. The transformer recognizes this pattern when the customer resumes browsing, enabling timely actions such as triggering a personalized abandonment email via AudienceStream.
  • Relationships between events are discovered automatically, surfacing hidden signals like cross-session purchase intent.
    Example: The model may learn that customers who repeatedly view premium products without purchasing are highly likely to convert when offered a targeted discount, enabling predictive activation.
  • Predictions such as churn risk, next-best-action, or dynamic audience classification are generated in real-time from these enriched event streams and can be immediately leveraged within Tealium AudienceStream for customer engagement.
    Example: The model may identify that a high-value user is likely to churn based on a recent drop in engagement compared to their historical behavior. AudienceStream can immediately trigger a personalized win-back offer to retain the user.

Common Scenarios Where Transformers Unlock Value

Event-level Capabilities:

  • Real-time Event Enrichment: Enhance raw events before they enter the CDP.
  • Predictive Analytics: Forecast key outcomes like churn, conversion, or high-value segments.
  • Dynamic Audience Segmentation: Classify users based on full interaction history, not just latest behavior.

Transformer-Powered Use Cases Across Industries

Retail & eCommerce

  • Personalized recommendations informed by sequential patterns, not just recent actions.
  • AI-driven cart abandonment prediction leading to timely and automated interventions.
  • Detects emerging trends through customer sentiment and behavioral analysis.

Financial Services

  • Detect fraud by uncovering suspicious transaction patterns.
  • Predict customer lifetime value based on behavioral sequences.
  • Assess risk profiles automatically by analyzing customer journeys.

Healthcare

  • Track patient journeys and personalize health interventions.
  • Enable early disease detection through sequential pattern analysis.
  • Predict patient disengagement and trigger targeted retention strategies.

Travel & Hospitality

  • Offer dynamic pricing based on real-time and historical booking behaviors.
  • Detect anomalies to enable predictive maintenance for fleet operations.
  • Deliver personalized travel itineraries by modeling complete customer journeys.

Why Integrate Transformers with Tealium

Tealium’s infrastructure is designed to support end-to-end real-time data processing:

  • Real-time ingestion of customer events via EventStream.
  • Event transformation and enrichment via Functions.
  • Activation-ready visitor profiles via AudienceStream.

By integrating transformer models into this pipeline, organizations can:

  • Deliver highly personalized experiences through predictive insights.
  • Enable smarter automation by triggering actions based on enriched event data.
  • Improve operational efficiency by enriching events before they enter the CDP.
  • Boost customer retention and lifetime value through timely, data-driven engagement.

Implementation Blueprint

Ingest: Collect and normalize customer events in real-time using Tealium EventStream.

Preprocess: Transform and enrich individual events using Tealium Functions, preparing them for model inference.

Deploy: Integrate transformer models into your cloud infrastructure to perform event-level inference, generating predictions or enriched features.

Activate: Feed enriched events and model outputs into Tealium AudienceStream to power real-time audience segmentation, personalization, and orchestration.

Optimize: Continuously monitor model performance and retrain to adapt to evolving customer behaviors, ensuring sustained business impact.

Continued Learnings

For more details on Tealium components mentioned in this article:

These resources provide further guidance on how to leverage Tealium’s Customer Data Hub to support predictive and AI-driven use cases.

Continued Learnings

For more details on Tealium components mentioned in this article:AIStream

The post Enriching Customer Event Data with Transformer Models appeared first on Tealium.

]]>
Delivering Personalized Content through your CMS with Tealium https://tealium.com/developer-center/delivering-personalized-content-through-your-cms-with-tealium Wed, 09 Apr 2025 21:08:36 +0000 https://tealium.com/?post_type=solution&p=82229 Pain Point CMS require timely delivery of customer attributes to execute personalized experiences in real-time. For example, a returning shopper who previously purchased in-store might see complementary products prioritized on the homepage of their next website visit. Benefit providers can surface relevant wellness articles to members based on their benefit plan when accessing their account […]

The post Delivering Personalized Content through your CMS with Tealium appeared first on Tealium.

]]>
Pain Point
CMS require timely delivery of customer attributes to execute personalized experiences in real-time. For example, a returning shopper who previously purchased in-store might see complementary products prioritized on the homepage of their next website visit. Benefit providers can surface relevant wellness articles to members based on their benefit plan when accessing their account portal. Experiences could also be keyed off insights from modeled data, such as choosing to display cross-sell or support content based on the latest sentiment score for the user. These types of experiences aren’t possible unless the CMS knows who the visitor is and what matters to them—right now.

Overview

Tealium offers flexible and highly performant methods for interacting with your Content Management System (CMS). This guide outlines the key integration options that apply to any CMS working with Tealium and how to leverage the Tealium Data Layer Enrichment API and Moments API to deliver personalized content delivery through your CMS.

Tealium interacts best with CMS platforms via front-end data layer interactions or direct API requests. This approach allows for greater adaptability across different CMS implementations.
The following integration methods apply to any CMS where Tealium is installed.

Integration Options

Tealium Data Layer Enrichment

Tealium Data Layer Enrichment (Requires a Tealium installation using JavaScript and a user session to be initialized.)

  • After a visitor triggers an event on your site, use the Data Layer Enrichment API to retrieve the visitor profile. API visitor data is available for two minutes after the last activity within a visit is received as an AudienceStream event.
  • This API returns all visitor profile attributes, and can have exacting values for specific offers or contexts for your CMS to execute following user login.
  • The return payload can be delivered through Tealium’s Collect Tag or via direct API request.

Data Layer Enrichment via Collect Tag

Data Layer Enrichment via API

Key Benefits:

  • Returns a complete visitor profile with audience memberships and attributes.
  • Can be used to power personalized content and recommendations.
  • Best suited for scenarios, such as next page personalization, where an active user session is available.

 

Tealium Moments API

Tealium Moments API (Retrieval API, no existing session required)

  • Make a request to the unique Moments API endpoint for visitor data. The Tealium Moments API configuration lets you define the specific attributes to return, so that the API sends a real-time, streamlined response back to your app/client.
  • Moments API returns visitor profile attributes similar to Data Layer Enrichment, but can be further optimized for speed and retrieval as it does not require an active user session to call Moments.
  • The CMS can trigger an API call to the Tealium Moments API to receive visitor data upon the user accessing the website. Though depending on your specific use-case, you may need known identifiers exposed if you wish to call Moments API with them (i.e. email address).

Moments API

Key Benefits:

  • Direct server access and can be used in cases where a session is not yet established.
  • Returns a streamlined set of visitor attributes as specified in the Moments API configuration.
  • Effective for personalization use cases that do not rely on previous event-based interactions.
  • Ideal for first-page personalization.

CMS Personalized Experience

Once the CMS receives a response from Tealium, it can leverage the enriched visitor data to deliver personalized content. The response can contain audiences, badges, and visitor attributes:

Below are code examples for each Tealium Moment’s API or Data Layer Enrichment, note you do not need to use both, but one or the other. The underlying outputs (customer profile data) is the same in either case, it’s simply the method that differs.

Moments API Response


{
    "audiences": [
        "Insurance Offers", 
        "Product Offers"
    ],
    "badges": [
        "13",
    ],    "properties": {
        "5050": ""
    },
    "flags": {
        "5052": false
    },
}

Data Layer Enrichment Response


{
        "audiences" : [
            {
                "id" : "myaccount_main_101",
                "name" : "Sample Audience"
            }
        ],
        "badges" : [
            {
                "id" : 5113,
                "name" : "Cart abandoner"
            },
            {
                "id" : 31,
                "name" : "Frequent visitor"
            },
            {
                "id" : 30,
                "name" : "Fan"
            }
        ]
    }

Use these attributes to create a tailored and dynamic experience in your CMS—whether it’s surfacing personalized offers, modifying content based on behavioral flags, or adjusting UI components in real time.
Following these integration patterns, developers can ensure seamless, scalable personalization across any CMS environment. Whether your goal is targeted marketing, dynamic content updates, or user experience optimization, Tealium provides the flexibility to make it happen.

By integrating Tealium with your CMS using either the Data Layer Enrichment API or the Moments API, you unlock real-time access to rich visitor profile data that can drive personalized content experiences from the very first page load. Whether you’re optimizing for logged-in users with active sessions or delivering targeted content to first-time visitors, Tealium offers developers the flexibility and control to meet personalization requirements across a wide range of CMS architectures.

These approaches not only streamline how data is accessed but also empower your CMS to act on it—ensuring faster time-to-value and a more relevant customer experience from the moment a user lands on your site.

Continued Learnings

For more details on Tealium components mentioned in this article:

Tealium MomentsAPI

The post Delivering Personalized Content through your CMS with Tealium appeared first on Tealium.

]]>
Optimizing AI Insights with Tealium’s Event, Visit, and Visitor Data Scopes https://tealium.com/developer-center/optimizing-ai-insights-with-tealiums-event-visit-and-visitor-data-scopes Jay Calavas]]> Wed, 09 Apr 2025 00:12:21 +0000 https://tealium.com/?post_type=solution&p=80477 Overview Effective AI-driven decision-making relies on structured, real-time data. The Tealium data model provides three distinct scopes—Event, Visit, and Visitor—to capture and process data at different levels, enabling precise AI applications and real-time insights. With sub-200ms latency, these scopes ensure that machine learning models receive accurate, actionable data without delay. Understanding Tealium’s Data Scopes for […]

The post Optimizing AI Insights with Tealium’s Event, Visit, and Visitor Data Scopes appeared first on Tealium.

]]>
Overview

Effective AI-driven decision-making relies on structured, real-time data. The Tealium data model provides three distinct scopes—Event, Visit, and Visitor—to capture and process data at different levels, enabling precise AI applications and real-time insights. With sub-200ms latency, these scopes ensure that machine learning models receive accurate, actionable data without delay.

Understanding Tealium’s Data Scopes for AI

Event Scope – Real-Time, Granular Data Processing

  • Captures individual user interactions (e.g., clicks, page views) as discrete events.
  • Enables low-latency adaptive modeling, real-time anomaly detection, and instant event-driven automation.
  • Supports AI models that require immediate data inputs for decision-making.

 

Visit Scope – Session-Based Aggregation for AI Modeling

  • Consolidates all user actions within a session for a contextual view.
  • Useful for session-based journey analysis, engagement scoring, and real-time exit prediction.
  • Provides AI with structured session-level insights for optimizing user experiences dynamically.

 

Visitor Scope – Longitudinal Data for Predictive AI

  • Tracks user behavior across multiple sessions for a persistent, historical view.
  • Essential for predictive lifetime value models, long-term personalization algorithms, and churn prediction.
  • Supports AI-driven segmentation and forecasting by analyzing behavioral trends over time.

Integrating Event, Visit, and Visitor Scopes for AI Optimization

Combining all three scopes enhances AI-driven applications by providing:

  • Multi-layered attribution modeling—event-level data for immediate tracking, visit-level for session context, and visitor-level for cross-session analysis.
  • Improved anomaly detection and fraud prevention by correlating real-time actions with historical behavior.
  • Dynamic user profiling for AI-driven personalization, adjusting content and recommendations in real-time.

Tealium’s sub-200ms real-time data processing ensures that AI models receive structured, high-velocity data for precise decision-making at every interaction level.

Continued Learnings

For more details on Tealium components mentioned in this article:

AIStream

 

The post Optimizing AI Insights with Tealium’s Event, Visit, and Visitor Data Scopes appeared first on Tealium.

]]>
Powering Real-Time Data with Events, Functions, and Attributes https://tealium.com/developer-center/powering-real-time-data-with-events-functions-and-attributes Jay Calavas]]> Tue, 08 Apr 2025 21:27:39 +0000 https://tealium.com/?post_type=solution&p=82205 Introduction Tealium’s platform enables seamless customer data orchestration through three core capabilities: Events, Functions, and Attributes. These components work together to capture, process, and enrich data in real-time, empowering businesses to drive personalized experiences, AI applications, and data-driven decision-making—all while ensuring compliance and accessibility. Tealium Events: Capturing Customer Interactions What Are Tealium Events? Tealium Events […]

The post Powering Real-Time Data with Events, Functions, and Attributes appeared first on Tealium.

]]>
Introduction

Tealium’s platform enables seamless customer data orchestration through three core capabilities: Events, Functions, and Attributes. These components work together to capture, process, and enrich data in real-time, empowering businesses to drive personalized experiences, AI applications, and data-driven decision-making—all while ensuring compliance and accessibility.

Tealium Events: Capturing Customer Interactions

What Are Tealium Events?

Tealium Events are consented user interactions captured across websites, mobile apps, and engagement channels. These interactions include page views, clicks, form submissions, video views, and more.

Key Benefits:

  • Provide insights into user behavior and engagement.
  • Enable real-time data activation without complex IT dependencies.
  • Managed via a no-code interface, making event setup and modification accessible to non-technical teams.

Tealium Functions: Real-Time Data Processing

What Are Tealium Functions?

Tealium Functions is a serverless data stream processing environment where developers can apply custom JavaScript logic to transform, clean, and enrich data before it’s activated.

Use Cases:

  • Categorize users based on engagement frequency.
  • Compute cart values and trigger personalized messaging.
  • Call external AI models for fraud detection, propensity scoring, or next-best-action insights.

Advantages:

  • Eliminates reliance on third-party transformation tools.
  • Enables real-time data manipulation without engineering delays.
  • Future-ready for natural language-driven function creation.

Tealium Attributes: Dynamic Customer Profiling

What Are Tealium Attributes?

Attributes define user characteristics such as demographics, behavior, and transaction history. These are dynamically updated as new events occur, enabling precise segmentation and personalization.

Examples of Attributes:

  • Badges: Identifying VIP customers based on lifetime purchase value.
  • Metrics: Tracking cart abandonment trends and customer lifetime value.
  • Tallies: Counting engagement actions like repeat visits or high-intent behaviors.

Why Use Tealium Attributes?

  • Enables real-time, in-the-moment customer segmentation.
  • Supports no-code management, making updates easy and scalable.
  • Ensures all attributes are calculated and resolved in under 200ms.

Real-World Applications

By leveraging Events, Functions, and Attributes, businesses can unlock powerful use cases, including:

  • AI-Ready Data Streams: Capture consented engagement data, obfuscate PII, and feed clean data to AI/CDW applications for advanced insights.
  • Personalized Product Recommendations: Track user interactions, determine preferences using Functions, and store preferences as Attributes for real-time personalization.
  • Cart Abandonment Recovery: Identify abandoned carts, calculate cart value via Functions, and trigger automated recovery messages for high-value customers.
  • Customer Lifetime Value Scoring: Aggregate total purchases, assign high-value badges, and deliver personalized rewards for loyal customers.

Conclusion: Turning Data Into Action

Tealium’s intuitive, low/no-code UI democratizes customer data management, enabling businesses to activate insights without extensive technical resources. With real-time data capture, transformation, and profiling, organizations can deliver personalized experiences, optimize AI applications, and enhance overall data strategy efficiently. By integrating Events, Functions, and Attributes, Tealium empowers teams to turn raw data into actionable intelligence—driving better customer engagement and business growth.

 

Continued Learnings

For more details on Tealium components mentioned in this article:

Tealium Functions

The post Powering Real-Time Data with Events, Functions, and Attributes appeared first on Tealium.

]]>