Prescient
Prescient AI is a marketing mix modeling platform. Prescient reads Rokt Ads performance from a table in your own Google BigQuery project, so you build that table from Rokt's reporting data and then point Prescient to it. This guide explains which Rokt metrics fill each column Prescient expects, and how to keep the table up to date.
PrerequisitesLien direct vers Prerequisites
- One Platform access. You need to sign in to One Platform to create a Rokt App ID and App Secret for the Query API. If you do not have access yet, contact your Rokt account manager and ask to be added as a managed user on your organization's One Platform account.
- A Google Cloud project with BigQuery. The table lives in your project, and Prescient reads it with a service account you create.
- A way to run a daily job, such as a scheduled script or your data pipeline tool, that calls the Query API and writes the results to BigQuery. Rokt does not write to BigQuery for you.
Generate API credentials in RoktLien direct vers Generate API credentials in Rokt
If you do not already have a credential pair, create one in One Platform:
- Sign in to One Platform at my.rokt.com.
- Open Profile Settings: click your account icon (bottom left), then choose Profile Settings.
- Scroll to Generate Personal API Credentials.
- Enter an application name (for example,
Prescient) and click Generate. - Copy the App ID and App Secret immediately.
You cannot view the App Secret again after you leave this step. Store it in a secret manager that your daily job can read. Do not commit secrets to source control.
For more detail, see Generating a Rokt App ID and App Secret.
Create the BigQuery tableLien direct vers Create the BigQuery table
Prescient expects one table with one row per date and campaign. Create it in a dataset that holds only your Rokt data, so you can share that dataset with Prescient and nothing else.
CREATE TABLE `your-project.rokt.rokt_daily_campaigns` (
date DATE NOT NULL,
campaign_name STRING NOT NULL,
campaign_id STRING NOT NULL,
tactic_type STRING NOT NULL,
spend FLOAT64 NOT NULL,
revenue FLOAT64,
conversions INT64,
clicks INT64,
impressions INT64
)
PARTITION BY date;
Replace your-project with your Google Cloud project ID. You can use other dataset and table names. Enter the names you choose in Prescient later. FLOAT64 and INT64 are the types Prescient lists as FLOAT and INTEGER.
Map Rokt metrics to Prescient's columnsLien direct vers Map Rokt metrics to Prescient's columns
Request a daily report from the Query API's Get Advertiser Report endpoint, grouped by campaign, and write each result row to the table:
| Prescient column | Required by Prescient | Rokt Query API field | Notes |
|---|---|---|---|
date | Yes | datetime | Take the first 10 characters (YYYY-MM-DD) as they are, and do not convert time zones. Each day starts at midnight in the timezoneVariation you request, even though the value ends in Z. For Catalog Ads, see Catalog Ads days below. |
campaign_name | Yes | campaign_name | |
campaign_id | Yes | campaign_id | Keep it as text, exactly as the Query API returns it. Rokt campaign IDs are 19 digits long, and tools that read them as numbers, such as spreadsheets, can change the last digits. |
tactic_type | Yes | None | Use one fixed value for every Rokt row. Prescient describes this column as the advertising channel type, such as Search, CTV, or Online Video. Ask your Prescient contact which value to use for Rokt. |
spend | Yes | net_cost | What Rokt charges you for your ads. See Spend below. |
revenue | No | conversion_value | Total value of all conversions, click-through and view-through, in US dollars. Use click_thru_conversion_value to send click-through revenue only. |
conversions | No | conversions | Total conversions. Use click_thru_conversions to send click-through conversions only. |
clicks | No | referrals | Rokt reports clicks as referrals: positive engagements with your ad. |
impressions | No | impressions |
With "interval": "day", Rokt returns one row per campaign per day. The Query API returns metric values as decimals, so round conversions, clicks, and impressions to whole numbers before you write them. Skip any row that has no campaign_id, so the table holds only campaign rows.
Example requestLien direct vers Example request
curl -X POST "https://api.rokt.com/v1/query/accounts/$ROKT_ACCOUNT_ID/campaigns/" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $BEARER_TOKEN" \
--data '{
"timezoneVariation": "America/New_York",
"currencyCode": "USD",
"interval": "day",
"startDate": "2026-10-28",
"endDate": "2026-11-04",
"dimensions": ["campaign_id", "campaign_name"],
"metrics": ["net_cost", "conversion_value", "conversions", "referrals", "impressions"]
}'
$BEARER_TOKENcomes from your App ID and App Secret. Access tokens expire after one hour, so request a new one on each run. See Generating an Access Token.$ROKT_ACCOUNT_IDis your Rokt account ID. The Query API's Account APIs list the accounts your credentials can read. If you advertise from more than one Rokt account, run the request for each account and write all rows to the same table.endDateis exclusive, so this example returns October 28 through November 3.- Set
timezoneVariationto match the time zone of your other channels in Prescient. currencyCodesets the currency ofnet_cost. Rokt reportsconversion_valueandclick_thru_conversion_valuein US dollars whatever currency you request. If your other channels are not in US dollars, convertrevenueto the same currency before you write it, so spend and revenue in each row share one currency.
SpendLien direct vers Spend
net_cost is your ad spend after any agency commission, which is what Rokt charges you. gross_cost is the same spend before agency commission, so use it only if you report spend before commission for your other channels too.
For Catalog Ads, on the days Rokt has billed, the Query API reports the amounts you were charged, so your table matches your Catalog Ads billing statement. Rokt bills Catalog Ads on a weekly billing run, so a day reports the spend recorded so far until it's billed, then the billed amount. Keep re-pulling each day until it has been billed, for example the last 14 days. See How billing works for Catalog Ads.
Catalog Ads daysLien direct vers Catalog Ads days
For Catalog Ads, on the days Rokt has billed, each row's metrics are counted on the UTC day with that row's date, whatever timezoneVariation you request. Your billing statement uses UTC days too. If your other channels in Prescient use a different time zone, a Rokt day can be offset from theirs by your time zone's UTC offset, but totals over whole days still match your invoice.
Load your history firstLien direct vers Load your history first
Before you connect the table in Prescient, run your job over every past date you have run Rokt campaigns, not only recent days, so Prescient's first import includes your Rokt history. Ask your Prescient contact how much history they need.
Keep the table up to dateLien direct vers Keep the table up to date
Rokt credits a conversion to the day the shopper clicked or saw your ad, not the day they bought. A day's conversions and revenue, and the spend of campaigns billed on conversions, can still change after that day ends. Run your job once a day, and on every run:
- Request a trailing range that is at least as long as your attribution window. For Catalog Ads, see How Catalog Ads attribution works, and cover the days not yet billed, as described in Spend.
- Replace the rows for those dates in one step, for example with a
MERGEstatement or a load job that overwrites those date partitions, so each date and campaign appears once and Prescient never reads a partly written day.
Connect the table in PrescientLien direct vers Connect the table in Prescient
- Follow Prescient's BigQuery Marketing Sources instructions to create a Google Cloud service account for Prescient.
- Give the service account these two roles and no others:
- BigQuery Data Viewer on the dataset that holds your Rokt table. In BigQuery, open the dataset, click Sharing > Permissions, and add the service account. Do not grant this role on the whole project.
- BigQuery Job User on the project. Google Cloud grants this role only on a project, so add it in IAM & Admin > IAM. It lets Prescient run queries and does not give access to any data by itself.
- Create a JSON key on the service account's Keys tab, and give it to Prescient as its setup screen asks. If Google Cloud doesn't let you create a key, your organization blocks service account keys. Ask your Google Cloud administrator to allow a key for this service account.
- In Prescient, open the Rokt via BigQuery connection.
- Enter the Dataset ID and Table ID of the table you created (in the example above,
roktandrokt_daily_campaigns), then click Save dataset.
Rokt may not appear in your Prescient results right away. Ask your Prescient contact when to expect it.
The JSON key lets anyone who holds it read your Rokt dataset. Give it to Prescient only through Prescient's setup screen, not by email or chat. After you add it to Prescient, delete the downloaded file, and never commit it to source control. If you stop using Prescient, delete the key in Google Cloud under IAM & Admin > Service Accounts > Keys.
Prescient's instructions ask for a table. Have your daily job write to a table rather than defining a BigQuery view.