Understanding Order of Events in AudienceStream

Understanding Order of Events in AudienceStream

by on ‎08-28-2016 12:46 PM - edited on ‎06-06-2018 02:33 PM by (1,697 Views)

To help explain how all the bits and pieces work together within AudienceStream (AS), and even between Tealium iQ (TiQ) and AS, this post will discuss the order of operations for events at a high level.

Page Load Events

Since AS relies heavily on a well-built data layer, let's cover what happens behind the scenes for a page load event. Click here for more information on the order of operations for the utag.js file.

Order of Operations on Page Load

  1. A visitor's browser loads your site and the utag_data object is declared within the site's source code.
  2. The utag.js script loads and triggers the TiQ library.
  3. The TiQ library builds the data layer, including the Universal Data Object (UDO), cookies, meta data, DOM elements, and JavaScript variables.
  4. The utag.js file fires your third-party vendor tags.
  5. The last tag to fire is the DataCloud Tag which sends the data layer to AS.

Order of Operations for AudienceStream

AS receives the data layer and initiates the following:

  1. AS evaluates rules to determine which attributes to enrich.
  2. AS enriches the appropriate attributes.
  3. Visitor profiles join or leave audiences as appropriate.
  4. The movement of visitor profiles into or out of your audiences triggers your actions.

Post Page Load Visitor Events

Any visitor-generated event that triggers a utag.link() or utag.view() call registers in AS. These types of events usually occur after the page loads. Due to the variety of configurations available for triggering tags, let's assume the most basic of configurations. Here is a sample call for an Add to Cart button click.

utag.view({event:"click", action:"add to cart", product_id="id123"});

The data declared within utag.link() is the new Data Layer. Since this event was triggered by a utag.link() call the order of operations slightly changes:

  1. The utag.link() call triggers and declares a new data layer.
  2. The TiQ library is re-initiated.
  3. The utag.js file fires vendor Ttags.
  4. The last tag to fire is the Tealium Collect Tag which sends the data layer to AS.

Once AudienceStream receives the new data, operations proceed as described above.

End-of-Session Events

AS is unique from TiQ in that it has the ability to determine the end of a session. Here is an example of a common "Cart Abandoner" badge that is evaluated at the end of a session, i.e. "WHEN" "Visit ended".

cart_abandon.png

The order of events that occur when the session ends are as follows:

  1. Any attribute enrichment that is configured "WHEN" "Visit ended" will evaluate the rule applied (The Cart Abandoned rule in the example above).
  2. Visitor profiles join or leave audiences as appropriate.
  3. AudienceStream triggers actions based on the movement of those visitor profiles.

Verifying with the Trace Tool

Initializing an AudienceStream Trace shows you the events occurring in real time. The latest events are placed at the top, so read the trace report from the bottom up to see the chronological order.

trace.png

Trace Glossary

  • Visitor Event Received = A page load, visitor, or end-of-session event occurred
  • Enriched Visitor Profile = AudienceStream evaluated rules and enriched attributes
  • Audience Joined/Left = A visitor profile joined or left an audience
  • Action Triggered/Processed = AudienceStream triggered an action based on the movement of a visitor profile