Build an Audience and Save It to Customer Profiles
You can create an audience table in BigQuery that includes multiple non-Boolean attribute values and then save it to Audience Builder in Customer Profiles for Data Collaboration. The audience table will appear as a dataset in Customer Profiles and will need to be added to the active taxonomy.
Tip
You can also create a segment table in BigQuery with a single column of IDs or with one or more columns of Boolean segment data values and save it to Customer Profiles. For information, see "Build a Segment and Save It to Customer Profiles."
To create an audience table that will be continually updated (Always On) and appear within the My Data folder inside the Audience Builder:
Create the table in the "_sg" dataset in BigQuery. Only tables created within the dataset ending in "_sg" can be saved to Customer Profiles.
The first column of the audience table should be labeled "ID" and contain the appropriate ID values (with no
UNMATCHED
or other non-RampID values). Make sure that your organization uses the same IDs in Customer Profiles. This is typically your client-encoded RampID. If you are unsure, create an Analytics Environment case in the LiveRamp Community portal.The maximum number of columns is 1,000 and can include a wide range of attribute values. If you need more columns, save multiple tables instead.
Specify meaningful table names and column headers because they will be used as the parent node names and audience names that campaign planners will see in Customer Profiles.
Caution
Saving an audience table with only Boolean values will cause the processing of the table to fail.
Example of an audience table with a single audience attribute:
Example of an audience table with multiple audience attributes:
Once you've created the audience table, save the audience table to Customer Profiles.
With the desired table open in the BigQuery Query Editor, select the Details tab.
Click
.From the Edit detail dialog, click
.Enter the following values, and then click
:key: "sendaudiencetocp"
Value 1: "ready"
To automatically send audiences at regular intervals, click
, enter the following values:Key 2: "frequency"
Value 2: Enter one of the following:
daily: Send the audience every day.
weekly_
<day_of_week>
: Send the audience every week on the specified day of the week. For example, weekly_monday indicates that the audience will be sent automatically every Monday.monthly_
<day_of_month>
: Send the audience every month on the specified day of the month (expressed as an integer). For example, monthly_31 indicates that the audience will be sent automatically every month on the last day of the month. If the specified integer exceeds the number of days in the month, the audience will be sent automatically on the last day of the month.
Click
The table's Details tab should indicate that the label was added successfully.
The audience should be available in Customer Profiles within an hour.
Note
If the audience table contains multiple segments, the audience table will appear as a dataset in Customer Profiles and will need to be added to the taxonomy. Follow the instructions in "Add a New Dataset to the Active Taxonomy."
Once the dataset has been added to the active taxonomy, the segment will appear in the "My Data" folder in the Audience Builder.
You can optionally use a script to create or replace tables and add the sendaudiencetocp
and ready
labels. The following BigQuery or Python examples can add labels and initiate the Save an Audience to Customer Profiles process. Other scripts might not work as intended.
Example BigQuery script for creating audience tables with labels:
create or replace table `project-id.dataset-name.table-name` OPTIONS(labels=[("sendaudiencetocp","ready")]) as select * from `project-id.dataset-name.table-name-A`
Example BigQuery script for creating audience tables with labels:
create table `project-id.dataset-name.table-name` ( x INT64, y STRING ) OPTIONS( labels=[("sendaudiencetocp","ready")] )
Example BigQuery script for updating audience tables with labels:
alter table `project-id.dataset-name.table-name` SET OPTIONS (labels=[("sendaudiencetocp", "ready")]);
Example Python script for updating audience tables with labels:
from google.cloud import bigquery bq_client = bigquery.Client() table = bq_client.get_table("project-id.dataset-name.table-name") table.labels['sendaudiencetocp'] = 'ready' bq_client.update_table(table, ['labels'])
Once a table is labeled as "ready", a backend process will detect that the table is ready to be sent to Customer Profiles, and the table label value changes to "processing."
When the table is processed successfully and sent to Customer Profiles, the label value changes to "success."
Note
If your audience table fails to be saved to Audience Builder, the label value changes to "fail." We will send you an email with details about the error and instructions on what to do to fix it.
If the guidelines for audience creation are not followed, the audience table will fail when being saved to Audience Builder. If your audience table fails to be sent, we will send you an email with details about the error and instructions on what to do to fix the error.
Example of an error email for an audience table with a column containing unencoded RampIDs:
You will also see a value of "fail" for the label key in BigQuery.
An audience table might also fail due to a transient error. If an error occurs again after resubmitting the audience table and you are unable to diagnose it, create a Safe Haven case in the LiveRamp Community portal.
The email will include the following information:
The organization name
The audience table name
The time sent (the day and time the label was added to the table)
The reason for the message
Instructions on how to fix the error (if applicable)
See the information below for instructions on how to fix these errors.
Reason for the Error | Description | Suggested Actions |
---|---|---|
The first column of the table does not contain RampIDs | The first column of the table must contain RampIDs. This error indicates we did not recognize the ID in the first column of the table as a RampID with your organization's expected encryption in string format. | Make sure that the first column of the table contains RampIDs, save the table, and then reapply the To ensure that there are no rows with a value of SELECT * FROM <table_name> WHERE ID NOT LIKE 'XY< If any rows contain invalid RampIDs, delete them from the table by running the following query: DELETE FROM <table_name> WHERE ID NOT LIKE 'XY< |
The audience table contains 1,000 or more columns | The audience table must not contain 1,000 or more columns. | Modify the table so that it contains fewer than 1,000 columns (or split the table into multiple tables), save the table, and then reapply the |
The first column of the table does not contain PPIDs | If your Safe Haven account uses PPID identifiers, the first column of the table must contain PPIDs. This error indicates we did not recognize the ID in the first column of the audience table as a PPID column with string format. | Make sure that the first column of the table contains PPIDs, save the table, and then reapply the To validate a list of PPIDs, run this query against your BigQuery table and then remove any rows with invalid PPIDs: SELECT COUNT(*) AS COUNT FROM (SELECT SAFE_CAST(ID AS INT64) AS ID FROM '<platform_name>.<organization_name>_sg.<SEGMENT_NAME>') WHERE ID <= 0 or ID is null; |
There was a transient error | This error indicates there has been either a transient or an unidentified error. | Reapply the |
Records were removed | Certain RampIDs were marked for deletion to comply with CCPA and GDPR, so they were removed from the table before saving it to Audience Builder. | This message is informational. |
Different Audience Sizes in Analytics Environment than in Customer Profiles
If your table has the same RampID on multiple rows, queries you run in BigQuery might not meet your expectations if you query for values that are located on different rows.
If you send your data from Analytics Environment to Customer Profiles, subsequent processing in Customer Profiles will combine information that appears on multiple rows but is associated with a single RampID, which typically results in a larger audience size.
The size of an audience in Analytics Environment can be different than in Customer Profiles even if your query logic appears to be the same in both.
For example, suppose you query a table in BigQuery for individuals with brand = 'PersonalCareCompany' AND gender = 'male'
but those values do not appear on the same row for the same RampID. Once the data is sent to Customer Profiles, the equivalent audience logic could result in a larger audience size than shown in the BigQuery results because Customer Profiles will query across rows for the same RampIDs.