This article shows how to set up an analytics ID on a landing page so that EventStream can correctly trigger the connector configured within the Customer Data Hub.

In this article:

Overview

The goal of this document is to described the logic needed to build an analytics vendor's client ID on the first page view or event so that EventStream can correctly trigger the connector configured within the Customer Data Hub.

Please note that this article focuses on Google Universal Analytics and Adobe Analytics, but can easily be modified for any analytics vendor as the base logic is vendor neutral.

EventStream

To quickly summarize Tealium's EventStream service, it is the ability to send event-level data to a vendor via our Cloud services. This can be done leveraging Tealium's Universal Library - utag.js for websites, SDK for applications - and the Customer Data Hub .

Typically when EventStream is used, the vendor library is removed from the web page or app. However, the vendor library would have set a random client ID in a cookie to be sent with each request, for example _ga for Google Universal Analytics or s_vi for Adobe Analytics. Therefore, it is up to Tealium to create a client ID that can be passed to the vendor in place of the cookie.

Order of Events

The Tealium Collect tag is responsible for gathering the Universal Data Object (UDO) and passing it to the Customer Data Hub. When the Customer Data Hub receives the UDO, it will check if any Live Events' Filtered Streams are matched. If a Filtered Stream is matched, any connector assigned to the Filtered Stream will trigger. Please note, all data to be sent to a vendor must be present when the event is captured to ensure a successful delivery.

Important Considerations

For mobile applications sending data via Tealium Collect - which skips triggering the Tealium Universal Library - this logic will not work due to the Javascript requirements that cannot be ran within the Customer Data Hub. However, the mobile developers should be setting a client ID with logic similar to the below that still allow you to take advantage of EventStream.

Tealium iQ - Google Configuration

First, in the Data Layer tab, declare a new Data Layer Variable called "utag_main__ga" of type "First Party Cookie".

store _ga data variable

Second, declare a new Data Layer Variable called "google_visitorid" of type "UDO Variable".

Google Client ID Data Source.png

Third, in the Extensions tab, create a new JavaScript Code extension that will build the client ID.

  • Scope to "All Tags"
  • The value is set in the data variable "google_visitorid" and the cookie "cp.utag_main__ga" which will be used in the connector configuration
  • Set a condition to run only when the client ID (utag_main__ga) is not defined

gua-visitor-id-javascript-code-extension.png

Here is the code to copy/paste into the extension:

var ts=Math.round(+new Date()/1000.0);
var rand;
try{
var uu32=new Uint32Array(1);
rand=crypto.getRandomValues(uu32)[0];
}catch(e){
rand=Math.round(Math.random()*2147483647);
}
gaid=[rand,ts].join('.');
utag.data["cp.utag_main__ga"]=gaid;
utag.loader.SC("utag_main",{_ga:gaid});
b.google_visitorid = gaid;

This code calculates the ID and stores it in the utag_main__ga cookie.

Save/Publish the changes.

Tealium iQ - Adobe Configuration

The Adobe visitor ID can be stated in several ways. First party deployments use an "s_vi" cookie, third party deployments use an "s_fid" cookie, and visitors can be identified by IP address/User Agent. However, you can also set your own visitor ID in s.visitorID. This section states how to use an Adobe cookies if either exist, otherwise pass Tealium's identifier - which is also browser based. For reference, this Adobe visitorID article states the order of use is:  s.visitorID > s_vi > s_fid > IP/UA.

First, in the Data Layer tab, declare two new Data Layer Variables called "s_vi" and "s_fid" of type "First Party Cookie".

See above for screenshot examples.

Second, declared a new Data Layer Variable called "adobe_visitorid" of type "UDO Variable".

Adobe Visitor ID Data Source

Third, in the Extensions tab, create a few Set Data Values Extension that will build the visitor ID based on the availability of data.

This extension sets adobe_visitorid to s_vi if the cookie exists.

Adobe Visitor ID - s_viThis extension sets adobe_visitorid to s_fid if the cookie exists.

Adobe Visitor ID - s_fid

And this extension sets adobe_visitorid to utag_main_v_id if neither cookie exists.

Adobe Visitor ID - v_id

Save/Publish the configurations.

EventStream - Google Configuration

First, add or edit your vendor connector.

Go to Act > Connector Marketplace and click the "Add Connector" button for Google Analytics, or go to Act > My Connectors to edit any existing connector.

Second, create a new action.

In the Actions tab of your connector, add an action for "Send Analytics Page View Data".

Third, configure the action.

Cloud Delivery - Connector Setup.png

  • Give the action a name
  • Choose a Filtered Stream from the "Source" drop-down
  • Either statically set a Tracking ID with a custom value, or select a data source to dynamically set the Tracking ID
  • Select the "utag_main__ga" data source to be mapped to "cid"
  • Select the "Client IP" data source to be mapped to "uip"
  • Select the "User Agent" data source to be mapped to "ua"
  • Select the "Current URL" data source to be mapped to "dl"

Passing the Client IP (IP address) will help with demographic reports. Please contact your CSM to have this enabled as it's an Admin setting.

Save/Publish the configurations.

EventStream - Adobe Configuration

First, add or edit your vendor connector.

Go to Act > Connector Marketplace and click the "Add Connector" button for Adobe Analytics, or go to Act > My Connectors to edit any existing connector.

Second, create a new action.

In the Configuration tab of your conncetor, input the domain and report suite ID.

In the Actions tab of your connector, add an action for "Post Data to Adobe Analytics".

Third, configure the action.

  • Give the action a name
  • Choose a Filtered Stream from the "Source" drop-down
  • Set a Report Suite ID with a static custom value, or select a data source to dynamically set the ID, or leave empty to use the ID input in the configuration of the previous step
  • Select the "adobe_visitorid" data source to be mapped to "visitorID"
  • Select the appropriate data source to be mapped to "pageName"
  • Select the "Current URL" source to be mapped to "pageURL"
  • Select the "Client IP" data source to be mapped to "ipaddress"
  • Select the "User Agent" data source to be mapped to "userAgent"

Adobe Connector Configuration.png

Passing the Client IP (IP address) will help with demographic reports. Please contact your Account/Deployment Manager to have this enabled as it's an admin setting.

Save/Publish the configurations.

Testing

Once the Tealium iQ and Customer Data Hub configurations are published, run a Trace in an incognito/private window and validate that the Google Client ID and Adobe Visitor ID are captured/built and sent. Filter your Network logs on "i.gif" to see the data sent in the Tealium Collect tag.

Collect Data

Here is the Trace window showing the successful event. Notice the Tracking ID and the client ID match and the 2 screenshots.

Trace Validation

Within Google Analytics, you can go to Reporting > Real-Time > Overview to see the data feeding into your report. We suggest add a querystring parameter to your test page such as ?tealiumtest=true to filter your data. If you are triggering data using the "Send Analytics Event Data" action, be sure to view the Reporting > Real-Time > Events report.

Cloud Delivery - Google Validation.png

Within Adobe Analytics, you can go to "Real-Time - Content Real-Time Report" to see the data feeding into your report.

Adobe Real-Time Report

Google References

Base code to develop Google client ID

measure.slack.com - must be a member of the community

Hit builder

Working with the Measurement Protocol

Adobe References

Adobe visitorID

Implementing Analytics Using JavaScript

Version history
Revision #:
26 of 26
Last update:
3 weeks ago
Updated by: