Working with AudienceDB and EventDB

Working with AudienceDB and EventDB

by Community Manager ‎03-14-2017 12:17 PM - edited ‎05-19-2017 08:25 AM (353 Views)

This article shows how to access your AudienceDB and EventDB services, which store your structured audience and event data in a Postgres-like database using Amazon Redshift where you can query the data directly with your preferred SQL client or BI tool.

These services must be activated for your account. Contact your account manager for more info.

This article covers:

Table of Contents Placeholder

How It Works

When the service is activated a unique database is created in Amazon Redshift to store your data. This database will contain tables for each kind of data that can be stored there. For Audience data, this will be "visit", "visitor", and attribute tables. For event data, each Stream has a corresponding table with event attributes represented as table columns. For your convenience, there are also views created to make your queries easier to consume.

AudienceDB

The tables available for audience data:

  • visitors - Includes Visitor Attributes and any Audiences they belong to 
  • visitor_lists - Includes Visitor Array Attributes only
  • visitor_tallies - Includes Visitor Tally Attributes only
  • visits - Includes current Visit Attributes and any Audiences they belong to
  • visit_lists - Includes current Visit Array Attributes only
  • visit_tallies - Includes current Visit Tally Attributes only
  • visitor_replaces - Visitor IDs that are stitched in the profile as part of Visitor Stitching

Each table has a corresponding view where "_view" is appended to the table name eg. "visitors_view". The table columns are named according to the attribute type and the internal attribute ID. For example, if you have a Badge attribute whose internal ID is "5099", the tables will have a column named "badge_5099". This is where the views come in handy because they provide user-friendly names for these columns. The corresponding column in the view might be "badge - visitor - VIP".

EventDB

The tables available for event data:

  • events_{STREAM} - Includes Event Attributes for all events in the Stream

Each table has a corresponding View to make it more convenient to browse the data. The table columns are named according to the attribute type and name, with only some attributes referencing internal ID's. Standard Universal Data Object variables will be named with a "udo_" prefix and most column names match their corresponding attribute names eg. "udo_event_name".

Event data coming from the Tealium Collect Tag will also include information about which tags executed on the page and page performance metrics.

See the EventDB Data Guide for more details. 

Enabling Data Storage

Attributes

Data storage is controlled at the Attribute level. Event Attributes and Visit/Visitor Attributes have a checkbox that determines if it will be stored in the database. Simply edit the Attribute and toggle this checkbox to include or omit the Attribute from the database.

Audiences

All Audiences are stored in AudienceDB.

Streams

Streams must be configured to have their data stored in EventDB. We recommend only enabling EventDB for the specific Streams you need since the amount of data can become quite large depending on your volume. See the guide on creating new Streams for more info.

Additionally, EventDB will collect preloaded attributes. These attributes are not editable from the Attributes screen, but you can adjust which ones are stored in EventDB via the DataAccess Console.

To adjust which preloaded attributes are stored in EventDB:

  1. Go to Act > DataAccess Console.
  2. In the area titled "DB is enabled", click Show EventDB Attributes.
  3. Check/Uncheck attributes to add/remove them from EventDB (by default all attributes are checked).
  4. Click Save.

DOM attributes (URL, domain, referrer, user agent, etc.) are always sent and cannot be excluded.

Database Credentials

You must use a third-party tool with Postgres support to connect to your database. These tools require authentication credentials to connect, which are provided in the DataAccess Console.

To get the database credentials:

  1. Navigate to Act > DataAccess Console.
  2. Click DB in the left-side navigation.
  3. Click Get DB Connection Details.

The following fields are displayed:

  • Username - The username for the database connection, usually a combination of your account/profile names.
  • Password - The password to connect to the database.

    Save the password for later. It cannot be retrieved once you close the dialog box.

  • Database - The name of the database, usually the name of your account.
  • Host - The host name of the database server, specific to your data storage region.
  • Port - The port number for the connection.

tealium-udh-db-connection-details.jpg

For security purposes the Password is only displayed once, so it's important to store it securely for later use. If you ever lose this value you can regenerate a new one, but it will invalidate all previous connections that used the old value.