MediaMath’s Data Platform enables advertisers to access the raw, event-level data generated through the TerminalOne platform in a tool-agnostic way. By leveraging cloud resources such as Amazon Web Services, clients can build value-added analytics services on top of MediaMath data with a minimum of developer time, money or hassle.

Data Platform Architecture

Data Platform Architecture

As campaigns and strategies created within TerminalOne bid and win, logs are written recording the dimensions and metrics of each individual impression. In addition, TerminalOne’s pixel servers log every event that is generated on an advertiser’s site (such as a page load, interaction or purchase). These log files are collected into a central processing system where attribution is run.

At the end of this process, raw log files are made available for access using the Data Platform, which collects the different log types and stores each organization’s data into a separate area using Amazon S3.

The following data sets are made available as part of Data Platform

  • Impressions - all impressions served by the T1 bidder
  • Events - Any event pixel fires from advertiser sites. Note this does NOT included data pixels or sync pixel fires.
  • Attributed Events - Clicks and conversions per campaign merit setup

Each event type is stored in a corresponding S3 bucket, partitioned by organization ID(organization_id). This ensure that Organizations can only access to their own data. For Attributed Events, there is one additional partition to the organization ID, which is by event type (event_type), possible values for this partition are “click” and “video”. This added partition groups the attributed events into regular click events and video events.

Accessing Data Platform Using AWS

How Data is Stored in S3

Data sets in the Data Platform are stored in S3 in the following locations

Data set S3 location
Impressions s3://mm-prod-platform-impressions/data/organization_id=[T1_ORGANIZATION_ID]/
Events s3://mm-prod-platform-events/data/organization_id=[T1_ORGANIZATION_ID]/
Attributed Events s3://mm-prod-platform-attributed-events/data/organization_id=[T1_ORGANIZATION_ID]/

In addition, each bucket has a public common directory which includes various utility data sets. See Using assets from the common folder for more details.

Data Security and Authorization

Data security is enforced using AWS Identity and Access Management. To access Data Platform you will need your own, valid AWS account and an IAM user with the sts:AssumeRole privilege.

To grant access to Data Platform, MediaMath takes your organization’s T1 ID and your AWS account ID and creates a new role within MediaMath’s AWS account. This role has a unique identifier called a Role ARN. This role grants access to your data, and can only be assumed from IAM users within your AWS account.

Below is a diagram showing how MediaMath leverages IAM to ensure the highest level of security for your data.

Data Platform Security

Obtaining Temporary Credentials to Access Data Platform

In order to access your data from MediaMath’s AWS account, first make sure that you have received a role ARN and an External ID from MediaMath. The role ARN should take the form of arn:aws:iam::794878508631:role/<ROLE_NAME> and the External ID should take the form of XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.

Next, attach a group policy to the IAM user who is trying to assume the role. The policy should use the role ARN provided by MediaMath and take the following form:

  {
    "Version": "2012-10-17",
    "Statement": {
        "Effect": "Allow",
        "Action": "sts:AssumeRole",
        "Resource": "arn:aws:iam::794878508631:role/<ROLE_NAME>"
    }
  }

Then, you need to call the sts:AssumeRole action from within your own AWS account, using both the role ARN and External ID provided by MediaMath. If the call succeeds (you are allowed to assume roles, and have been authorized to assume the role MediaMath created) you will receive a set of temporary credenials to access your data.

The below Python script can be used as a starting point.

import os
import boto3 # 1.7.4
import sys
AWS_ACCESS_KEY_ID     = '' # Access key ID
AWS_SECRET_ACCESS_KEY = '' # Secret access key
ROLE_NAME             = '' # DPA-{USER}   ex: DPA-Mediamath
EXTERNAL_ID           = '' # MediaMath provided
ORGANIZATION_ID       = '' # MediaMath organization id
S3_BUCKET             = 'mm-prod-platform-impressions'
# ------------------------------------------------ DO NOT ALTER BELOW ------------------------------------------------ #
ROLE_SESSION_NAME     = 'data-platform'
BASE_ROLE_ARN         = 'arn:aws:iam::794878508631:role/'  
ROLE_ARN              = BASE_ROLE_ARN + ROLE_NAME
DURATION_SECONDS      = 3600
client = boto3.client(
    'sts',
    aws_access_key_id=AWS_ACCESS_KEY_ID,
    aws_secret_access_key=AWS_SECRET_ACCESS_KEY
)
role = client.assume_role(
    RoleArn=ROLE_ARN,
    RoleSessionName=ROLE_SESSION_NAME,
    DurationSeconds=DURATION_SECONDS,
    ExternalId=EXTERNAL_ID
)
session = boto3.session.Session(
		aws_access_key_id=role['Credentials']['AccessKeyId'],
		aws_secret_access_key=role['Credentials']['SecretAccessKey'],
		aws_session_token=role['Credentials']['SessionToken']
)
S3 = session.resource('s3')
my_bucket = S3.Bucket(S3_BUCKET)
for object_summary in my_bucket.objects.filter(Prefix='data/organization_id=' + ORGANIZATION_ID + '/'):
    print (object_summary.key)

NOTE: temporary security credentials last a maximum of 1 hour. See the best practices section for information about loading many days worth of data in bulk.

When connecting to a Log-Level Service bucket using AWS CLI, you will need to configure the client to assume the correct role. To do this, we will need to set up two things:

  1. A valid Access Key ID and Secret Access Key from the source account in .aws/credentials
  2. The role ARN provided by MediaMath and source profile (from step 1) in .aws/config

For instance:

.aws/credentials:

[log_level_source]
aws_access_key_id = myaccesskey
aws_secret_access_key = mysecretkey

.aws/config:

[profile log_level]
role_arn = arn:aws:iam::794878508631:role/DPA-MyCompany
source_profile = log_level_source

With this set up, you can use the CLI with the --profile flag, like such:

$ aws --profile log_level s3 ls s3://mm-prod-platform-impressions/common/

The AWS CLI will take care of assuming the role and caching the temporary credentials for you. When the token provided is expired, the CLI will also re-issue the AssumeRole command and store the new temporary credentials. You can actually see the result of the AssumeRole command if you look in .aws/cli/cache—there should be a file named, in this example, log_level--arn_aws_iam__794878508631_role-DPA-MyCompany.json.

Working with Data Platform

The following section details information needed to process the raw data avaialble via Data Platform.

Data Platform File Formats and Schemas

Data Platform data sets are stored as tab-separated files. TSV is an easy to parse format, ready for loading into any downstream system such as an RDBMS or Hadoop.

Any string fields containing tab characters are cleansed so tabs are replaced as . to avoid breaking downstream parsers.

Unless noted otherwise, all columns should be considered nullable. A null is written in the TSV files as \N.

See Appendix A for a detailed description of the schemas, including data types.

Data Update Cycle

Data Platform is updated 3x per day. However, due to ever changing data sets the completion times of the refresh is not held to a strict SLA. The times below are estimates - please allow for delays as data growth can produce unexpected delays.

GMT (London)
Batch number Delivered around (GMT) Includes data from (GMT)
0 04:30 today 18:00 yesterday - 02:00 today
1 12:30 today 02:00 today - 10:00 today
2 20:30 today 10:00 today - 18:00 today
EST (New York)
Batch number Delivered around (GMT-5) Includes data from (GMT-5)
1 07:30 today 21:00 yesterday - 05:00 today
2 15:30 today 05:00 today - 13:00 today
0 23:30 today 13:00 today - 21:00 today
JST (Tokyo)
Batch number Delivered around (GMT+9) Includes data from (GMT+9)
2 05:30 today 19:00 yesterday - 03:00 today
0 13:30 today 03:00 today - 11:00 today
1 21:30 today 11:00 today - 19:00 today

Using assets from the common/ folder

The common/ directory of each Data Platform S3 bucket has several utility data sets including

  • Create table statements for different RDBMs
  • Header row files which list the column titles
  • Refresh logs that can be used to tell when Data Platform data sets have been updated

Update logs

Every time a batch of Data Platform logs are completely uploaded to S3, an empty file is uploaded to the /common/completion-status/ directory of the bucket (this is true for impression logs, event logs, and attributed event logs). The first time a batch of data is processed and uploaded to S3 a 0-byte file of the name

  • mm_impressions_batch_[BATCH_ID].done
  • mm_events_batch_[BATCH_ID].done
  • mm_attributed_events_batch_[BATCH_ID].done

is loaded to /common/completion-status/. The batch ID is an 8-digit code of the type YYYYMMDDNN where YYYYMMDD represents a date and NN is either 00, 01, or 02 (representing the first, second and third batches of data processed every day).

For example, on 7/1, we would normally expect the directory s3://mm-prod-platform-impressions/common/completion-status/ to contain the following three files:

  • mm_impressions_batch_2018070100.done - loaded upon completion of the first batch on 7/1
  • mm_impressions_batch_2018070101.done - loaded upon completion of the second batch on 7/1
  • mm_impressions_batch_2018070102.done - loaded upon completion of the third batch on 7/1

It is important not to download or begin processing any log data before the appearance of this ‘.done’ file: a batch usually will upload to S3 several files, even for a particular organization and impression date. Thus even if some files from batch 2018070102 have appeared in /data/, we can not be certain that more files will not appear presently until we find the 0-byte mm_impressions_batch_2018070102.done file in /common/completion-status/.

Rarely, but on occasion, a particular batch of data may get processed later than expected. For example, suppose an unexepected service interruption prevented batch 2018070102 of impression log data from being processed on 7/1 (batch 2 is usually available in S3 no later than 20:30 GMT), and instead this batch of data was not processed until 7/3. In this case, upon completion of the upload of data from batch 2018070102 the file mm_impressions_batch_2018070102.done would get uploaded into

/common/completion-status/

Special Considerations for Loading Attributed Events

Clients have the ability to change the merit pixel, pc window and pv window at any time throughout the duration of a campaign. If changed, the changes to the window will only be reflected moving forward. T1 reporting and API’s will not recalculate the past data with the new window.

During each load of the attributed-events S3 bucket the last 5 days of data are updated.

If you expect frequent changes to campaign lookback windows, you may also consider dropping and reloading the last 5 days of attributed event data on each import to keep your attributed events tables in sync. If you do not anticipate frequent changes you can simply ignore the attributed event restatements.

Attributed events data is not lzo-compressed.

Schema migrations

Schemas should be considered stable, and will only be changed via a scheduled maintenance cycle.

Best Practices for Loading Data

  • Load into a staging area
  • Load N days at a time to account for late arriving data
  • Split the load into phases to so your credentials don’t expire
  • Reload conversion data for past 5 days
  • Be defensive with invalid lines

Using Data Platform with 3rd Party Tools

Redshift

Data Mining Console /Qubole

All advertiser log level data driven by T1 can be accessed in Data Mining Console (DMC). DMC is a SQL based query tool that allows users to dive deeper into their log level data, creating valuable insights that help drive media budget and campaign optimization. More information on Data Mining Console can be found here.

Hadoop/Hive

  • Hive
  • Elastic Mapreduce
  • Scalding

Data Platform Schemas

All columns should be considered nullable unless otherwise noted.

Please note: an up-to-date schema can always be found on each bucket under the “common/create-table/” prefix.

Impressions

Name Type Description
timestamp_gmt timestamp time of the impression in GMT
report_timestamp timestamp time of the impression in campaign's local timezone
auction_id long auction ID that uniquely identifies an impression
mm_uuid string MediaMath unique user Id
organization_id integer
organization_name string
agency_id integer
agency_name string
advertiser_id integer
advertiser_name string
campaign_id integer MediaMath unique ID for campaign
campaign_name string MediaMath name for campaign
strategy_id integer MediaMath unique ID for strategies
strategy_name string MediaMath name for strategies
concept_id integer MediaMath unique ID for creative concept
concept_name string MediaMath name for creative concept
creative_id integer MediaMath ID of the T1 creative displayed for the impression
creative_name string MediaMath name of the T1 creative displayed for the impression
exchange_id integer MediaMath unique ID for exchange of impression bid
exchange_name string MediaMath unique name for exchange of impression bid
width integer Creative width in pixels
height integer Creative height in pixels
site_url string domain where impression was served
day_of_week integer day of week of impression served; 0=Sunday to 6=Saturday.
week_hour_part integer hour of week of impression served; 0=Sunday 12am, 1=Sunday 12:15am, ... 671=Saturday 11:45pm.
media_cost_cpm double Total of clearing prices for impressions won
total_ad_cost_cpm double Total of Media cost plus any cost designated as Ad Serving, Ad Verification, Audience/Data, Contextual, Privacy Compliance, Surveys
total_spend_cpm double Total Ad Cost plus MediaMath Fees and Agency Margin
mm_creative_size integer 32-bit encoding of creative size, calculated by making the high 16 bits the width and the low 16 bits the height
placement_id long The PlacementSlot ID for PMP-D (the value in "pmp" param in a PMP-D request)
deal_id long deal ID when the impression is associated with a private deal arranged to be served through the exchange
country_id integer MediaMath unique ID of country in which the impression is served
country string country in which the impression is served
region_id integer state ID for the state in which the impression is served
region string state in which the impression is served
dma_id integer DMA ID in which the impression is served
dma string DMA in which the impression is served
zip_code_id integer zip code ID for the zip code in which the impression is served
zip_code string zip code in which the impression is served
conn_speed_id integer MediaMath unique ID for Internet connection speed through which the impression is served
conn_speed string Internet connection speed through which the impression is served
isp_id integer MediaMath unique ID for Internet service provider through which the impression is served
isp string Internet service provider through which the impression is served
category_id integer The exchange-provided category ID for the page (e.g. sports page vs. news page).
publisher_id long online publisher where the impression is served (passed from exchange)
site_id long siteID as provided by the exchange
watermark integer whether impression used in Watermark process by MediaMath's optimization engine
fold_position integer indication of fold position (above, below, unknown) for the impression served where 1 = Above the fold, 2 = Below the fold, 0 = Unknown
empty_int_1 null Deprecated field. Will always be null.
user_frequency integer exchange provided user frequency
browser_id integer MedaMath unique ID of Browser where impression served
browser string browser where impression served
os_id integer MediaMath unique ID for the Operating System on which the impression is served
os string Operating System on which the impression is served
browser_language_id integer MediaMath unique ID for the lanugage setting on user's browser on which impression is served
user_agent string user agent header string as passed by Browser
week_part integer week part of impression served (based on user's time zone); 0=weekday, 1=weekend.
day_part integer day Part in which the impression was served (based on the user's timezone); 0=12am-6am, 1=6am-12pm, 2=12pm-6pm, 3=6pm-12am.
day_hour integer hour of day impression served (based on user's timezone); Irrespective of day (0-23).
week_part_hour integer hour of week of impression served 0-23 for weekday hours, 24-47 for weekend
hour_part integer hour of a given day in which the impression served (based on the user's timezone). 15 min increment of hour of impression served0=12:00am, 1=12:15am, ... 95=11:45pm
week_part_hour_part integer 0-95 weekday, 96-191 weekend.
week_hour integer 0=Sunday 12am, 1=Sunday 1am, ...167=Saturday 11pm.
page_url string page URL of impression served as passed by exchange
batch_id long eight-digit identifier of the batch that generated the file, of the format YYYYMediaMathDDNN where YYYYMediaMathDD is the processing date and NN is either 00, 01 or 02, corresponding to the first, second, and third batches of processed date each day
browser_language string the language of the browser on which impression is served
inventory_type_id integer Internal unique identifier that corresponds to inventory_type: 50000=Web, 50001=Optimized, 50002=In-App, -1=Unknown.
channel_type long 1 = Display, 2 = Video, 3 = Social, 4 = mobile display (web), 5 = mobile video (web), 6 = search, 7 = email, 8 = mobile display (in-app), 9 = mobile video (in-app), 10 = Newsfeed (FBX)
empty_field_1 null Deprecated field. Will always be null.
empty_field_2 null Deprecated field. Will always be null.
inventory_type string Environment in which the user received the impression: Web, Optimized, In-App, Unknown. Derived from the user_agent string.
device string Device type on which the impression is served, e.g. "Smartphone", "Laptop/Desktop"
device_id integer Numeric ID corresponding to the value of the 'device' field
homebiz_type string Connection type ('business' or 'home'). Also known as 'Connection Type' in T1 Reports
homebiz_type_id integer Numeric ID corresponding to the value of the 'homebiz_type' field
connected_id string NOTE: this column will only be populated with data if the Organization has additional agreements establish with MediaMath. Please contact your account representatives if you are interested in receiving data for this.
app_id string either App ID or Bundle ID of app to which impression is served, if present
city integer
city_code string
city_code_id integer
aib_pixel_ids string
aib_recencies string
supply_source_id integer
id_vintage integer 0 if the primary MM user id from bid request is [0 and 1 week old), 1 if is [1 and 18 weeks old), 2 if [18 and 52 weeks old), 9 if no MM user id or more than 52 weeks old
interstitial integer 1 if it's an interstitial inventory
cross_device_flag integer A flag to tell if the impression is cross-device and/or cookieless, value from 0 to 8
overlapped_brain_pixel_selections string Pipe-separated list of pixel ID's eligible for the user from the list of nominated pixels in T1.Includes the Recency (measured in minutes) and Frequency (# of fires over the past 30d days) of the pixel. Example: mm:745587:20488:5|mm:745334:20500:1
ip_address string defaulted to "NULL" due to GDPR
delphi_metadata string Price engine metadata. Currently formatted as campaign_id&"_"&model_id
norm_rr float Predicted response rate from FMV Brain. Denominated in RR per 1k imps
browser_name string Name of the browser from WURFL Enrichment
browser_version string Version of the browser from WURFL Enrichment
os_name string Name of the operating system from WURFL Enrichment
os_version string Version of the operating system from WURFL Enrichment
model_name string Name of the model from from WURFL Enrichment
brand_name string Name of the brand from WURFL Enrichment
form_factor string Device Type from WURFL Enrichment
contextual_data string
viewability_tag_injection integer Whether we injected viewability tag
prebid_viewability string Prebid viewability value as reported by the exchange
prebid_historical_ctr string Prebid historical click through rate as reported by the exchange
prebid_video_completion string Prebid predicted video completion as reported by the exchange
overlapped_pixels string Comma-separated list of any pixel IDs targeted and matched for this impression
auction_type integer from bid request (0 - unknown; 1 - first price; 2 - second price plus; 3 - fixed price (deal) ; 501 - Not Indicated)
deal_group integer The deal group of the deal which is associated with the impression
brain_type_id integer An internal MediaMath ID that describes which brain model was used to bid for the corresponding impression
video_skippability integer Flag to identify video skippability ; 0: non-skippable; 1: skippable; null: unknown
video_placement_type integer Video placement type. 1: In-stream; 2: In-banner; 3: In-article; 4: In-feed; 5: Interstitial/slider/floating

Events

Name Type Description
timestamp_gmt timestamp timestamp of event pixel fire in GMT
mm_uuid string MediaMath unique user ID
hostname string The hostname of the server handling the request, almost always `pixel.mathtag.com`
organization_id integer
organization_name string
agency_id integer
agency_name string
advertiser_id integer
advertiser_name string
pixel_id integer MediaMath unique ID for event pixel
pixel_name string event pixel name (user defined)
v1 string custom variable (associated with pixel_id above - Since not all pixels are passing back same variables); max 64 characters
v2 string custom variable; max 64 characters
v3 string custom variable; max 64 characters
v4 string custom variable; max 64 characters
v5 string custom variable; max 64 characters
v6 string custom variable; max 64 characters
v7 string custom variable; max 64 characters
v8 string custom variable; max 64 characters
v9 string custom variable; max 64 characters
v10 string custom variable; max 64 characters
s1 string custom variable; max 64 characters
s2 string custom variable; max 64 characters
s3 string custom variable; max 64 characters
s4 string custom variable; max 64 characters
s5 string custom variable; max 64 characters
s6 string custom variable; max 64 characters
s7 string custom variable; max 64 characters
s8 string custom variable; max 64 characters
s9 string custom variable; max 64 characters
s10 string custom variable; max 64 characters
country_id integer MediaMath unique ID of country in which the impression is served
country string country in which the impression is served
region_id integer state ID for the state in which the impression is served
region string state in which the impression is served
dma_id integer DMA ID in which the impression is served
dma string DMA in which the impression is served
zip_code_id integer zip code ID for the zip code in which the impression is served
zip_code string zip code in which the impression is served
conn_speed_id integer MediaMath unique ID for Internet connection speed through which the impression is served
conn_speed string Internet connection speed through which the impression is served
isp_id integer MediaMath unique ID for Internet service provider through which the impression is served
isp string Internet service provider through which the impression is served
user_agent string user agent header string as passed by Browser
referrer string referring URL of the page where the event pixel has fired
batch_id long eight-digit identifier of the batch that generated the file, of the format YYYYMediaMathDDNN where YYYYMediaMathDD is the processing date and NN is either 00, 01 or 02, corresponding to the first, second, and third batches of processed date each day
homebiz_type_id integer also known as ‘Connection Type’ in T1 Reports; values are either ‘business’ or ‘home’
homebiz_type string also known as ‘Connection Type’ in T1 Reports; values are either ‘business’ or ‘home’
connected_id string NOTE: this column will only be populated with data if the Organization has additional agreements establish with MediaMath. Please contact your account representatives if you are interested in receiving data for this.
city integer
city_code string
city_code_id integer
pixel_params string
id_type string
ip_address string

Attributed Events

Name Type Description
impression_timestamp_gmt timestamp timestamp of impression served in GMT
event_timestamp_gmt timestamp timestamp of merit pixel fire in GMT
event_report_timestamp timestamp timestamp of event pixel record in T1/MediaMath
imp_auction_id long unique ID generated by MediaMath’s bidder to identify an impression
mm_uuid string MediaMath unique user identifier
organization_id integer
organization_name string
agency_id integer
agency_name string
advertiser_id integer
advertiser_name string
event_type string ‘click’ or ‘conversion’
pixel_id integer merit pixel ID for the attributed event record
pixel_name string merit pixel name for the attributed event record
pv_pc_flag string post-View or post-Click conversion Flag. Returns PV or PC
pv_time_lag integer time in seconds following impression view to event pixel fire
pc_time_lag integer time in seconds following impression click to event pixel fire
campaign_id integer MediaMath unique ID for campaign
campaign_name string MediaMath name for campaign
strategy_id integer MediaMath unique ID for strategies
strategy_name string MediaMath name for strategies
concept_id integer MediaMath unique ID for creative concept
concept_name string MediaMath name for creative concept
creative_id integer MediaMath unique ID for specific creative
creative_name string MediaMath name for specific creative
exchange_id integer MediaMath unique ID for exchange of impression bid
exchange_name string MediaMath name for exchange of impression bid
width integer sizes encoded as 32-bit integers with the high 16 bits are width and the low 16 bits are height
height integer sizes encoded as 32-bit integers with the high 16 bits are width and the low 16 bits are height
site_url string base url where impression was served
mm_v1 string custom variable; Max 64 characters
mm_v2 string custom variable; Max 64 characters
mm_s1 string custom variable; Max 64 characters
mm_s2 string custom variable; Max 64 characters
day_of_week integer day of a given week in which the impression served (based on the user’s timezone)
week_hour_part integer hour of week of conversion
mm_creative_size integer 32-bit encoding of creative size
placement_id long PlacementSlot ID for PMP-D (the value in “pmp” param in a PMP-D request)
deal_id long deal ID when the impression is associated with a private deal arranged to be served through the exchange
country_id integer MediaMath unique ID of country where impression served
country string country where impression served
region_id integer state ID for the state in which the impression is served
region string state in which the impression is served
dma_id integer DMA ID in which the impression is served
dma string DMA in which the impression is served
zip_code_id integer zip code ID for the zip code in which the impression is served
zip_code string zip code in which the impression is served
conn_speed_id integer MediaMath unique ID for Internet connection speed through which the impression is served
conn_speed string Internet connection speed through which the impression is served
isp_id integer MediaMath unique ID for Internet service provider through which the impression is served
isp string Internet service provider through which the impression is served
category_id long content category of page - passed from publisher
publisher_id long exchange provided publisher ID
site_id long siteID as provided by the exchange; The online website where the impression is served
watermark integer whether impression used as part of the watermark process by MediaMath’s optimization algorithm
fold_position integer indication of fold position (above, below, unknown) for the impression served where 1 = Above the fold, 2 = Below the fold, 0 = Unknown
user_frequency integer exchange provided user frequency
browser_id integer MedaMath unique ID of Browser where impression served
browser string browser where impression served
os_id integer MediaMath unique ID for the Operating System on which the impression is served
os string Operating System on which the impression is served
browser_language_id integer MediaMath unique ID for the lanugage setting on user’s browser on which impression is served
week_part integer enumerated value representative of weekday vs weekend in which the impression was served (based on the user’s timezone)
day_part integer day part of impression served
day_hour integer hour of day impression served
week_part_hour integer enumerated value representative of the hour within a given day and with distinction between weekday and weekend hours in which the impression served (based on the user’s timezone)
hour_part integer 15 min block of a given day in which the impression served (based on the user’s timezone)
week_part_hour_part integer enumerated value representative of the 15 min block of a day with distinction between weekday and weekend 15 min blocks in which the impression served (based on the user’s timezone)
week_hour integer enumerated value representative of the hour of a given week in which the impression served (based on the user’s timezone)
batch_id long eight-digit identifier of the batch that generated the file, of the format YYYYMediaMathDDNN where YYYYMediaMathDD is the processing date and NN is either 00, 01 or 02, corresponding to the first, second, and third batches of processed date each day
browser_language string language configured on the browser at the time the impression served
empty_int_1 null Deprecated field. Will always be null.
inventory_type integer 1 = exchange, 2 = PMP exchange, 3 = PMP Direct
inventory_id integer PMP-D => site_placement_id, PMP-E => deal_id, PRM =>site_placement_id otherwise blank
homebiz_type_id integer also known as ‘connection Type’ in T1 Reports; values are either ‘business’ or ‘home’
homebiz_type string also known as ‘connection Type’ in T1 Reports; values are either ‘business’ or ‘home’
device_type_id integer MediaMath unique ID for the device on which the impression is served
device_type string the device on which the impression is served
connected_id string NOTE: this column will only be populated with data if the Organization has additional agreements establish with MediaMath. Please contact your account representatives if you are interested in receiving data for this.
app_id string either App ID or Bundle ID of App to which impression is served, if present
event_subtype string This field is blank for non-video events. For video events, here are the possible values: companion_click, companion_impression, accept_invitation, close, collapse, vv, engagedView, expand, fullscreen, mute, pause, q1, q2, q3, q4, resume, rewind, skip, skippable, vst, unmute, na, impression, error.
city integer
city_code string
city_code_id integer
supply_source_id integer
ip_address string
browser_name string Name of the browser from WURFL Enrichment
browser_version string Version of the browser from WURFL Enrichment
os_name string Name of the operating system from WURFL Enrichment
os_version string Version of the operating system from WURFL Enrichment
model_name string Name of the model from WURFL Enrichment
brand_name string Name of the brand from WURFL Enrichment
form_factor string Device Type from WURFL Enrichment
impressions_stream_uuid string Impression Stream Unique Identifier
clicks bigint Clicks
pc_conversions bigint Post click conversion
pv_conversions bigint Post view conversion
pc_revenue float Post click revenue
pv_revenue float Post view revenue

Viewability Events

Name Type Description
impression_timestamp_gmt timestamp Timestamp of impression served in GMT
event_timestamp_gmt timestamp Timestamp of viewability event fired by the vendor in GMT. This is not related to a T1 pixel or campaign merit event
event_report_timestamp timestamp Timestamp of viewability event fired by the vendor in campaign’s local timezone
imp_auction_id long unique ID generated by MediaMath’s bidder to identify an impression
mm_uuid string MediaMath unique user identifier
organization_id integer
organization_name string
agency_id integer
agency_name string
advertiser_id integer
advertiser_name string
pixel_id integer merit pixel ID for the attributed event record
pixel_name string merit pixel name for the attributed event record
campaign_id integer MediaMath unique ID for campaign
campaign_name string MediaMath name for campaign
strategy_id integer MediaMath unique ID for strategies
strategy_name string MediaMath name for strategies
concept_id integer MediaMath unique ID for creative concept
concept_name string MediaMath name for creative concept
creative_id integer MediaMath unique ID for specific creative
creative_name string MediaMath name for specific creative
exchange_id integer MediaMath unique ID for exchange of impression bid
exchange_name string MediaMath name for exchange of impression bid
supply_source_id integer
width integer sizes encoded as 32-bit integers with the high 16 bits are width and the low 16 bits are height
height integer sizes encoded as 32-bit integers with the high 16 bits are width and the low 16 bits are height
site_url string base url where impression was served
mm_v1 string custom variable; Max 64 characters
mm_v2 string custom variable; Max 64 characters
mm_s1 string custom variable; Max 64 characters
mm_s2 string custom variable; Max 64 characters
day_of_week integer day of a given week in which the impression served (based on the user’s timezone)
week_hour_part integer hour of week of conversion
mm_creative_size integer 32-bit encoding of creative size
placement_id long PlacementSlot ID for PMP-D (the value in “pmp” param in a PMP-D request)
deal_id long deal ID when the impression is associated with a private deal arranged to be served through the exchange
country_id integer MediaMath unique ID of country where impression served
country string country where impression served
region_id integer state ID for the state in which the impression is served
region string state in which the impression is served
dma_id integer DMA ID in which the impression is served
dma string DMA in which the impression is served
zip_code_id integer zip code ID for the zip code in which the impression is served
zip_code string zip code in which the impression is served
city integer
city_code_id integer
city_code string
conn_speed_id integer MediaMath unique ID for Internet connection speed through which the impression is served
conn_speed string Internet connection speed through which the impression is served
isp_id integer MediaMath unique ID for Internet service provider through which the impression is served
isp string Internet service provider through which the impression is served
category_id long content category of page - passed from publisher
publisher_id long exchange provided publisher ID
site_id long siteID as provided by the exchange; The online website where the impression is served
watermark integer whether impression used as part of the watermark process by MediaMath’s optimization algorithm
fold_position integer Indication of fold position (above, below, unknown) for the impression served where 1 = Above the fold, 2 = Below the fold, 0 = Unknownd
user_frequency integer exchange provided user frequency
browser_id integer MedaMath unique ID of Browser where impression served
browser string browser where impression served
os_id integer MediaMath unique ID for the Operating System on which the impression is served
os string Operating System on which the impression is served
browser_language_id integer MediaMath unique ID for the lanugage setting on user’s browser on which impression is served
browser_language string
device_id integer
device string
week_part integer enumerated value representative of weekday vs weekend in which the impression was served (based on the user’s timezone)
day_part integer day part of impression served
hour integer hour of day impression served
week_part_hour integer enumerated value representative of the hour within a given day and with distinction between weekday and weekend hours in which the impression served (based on the user’s timezone)
hour_part integer 15 min block of a given day in which the impression served (based on the user’s timezone)
week_part_hour_part integer enumerated value representative of the 15 min block of a day with distinction between weekday and weekend 15 min blocks in which the impression served (based on the user’s timezone)
week_hour integer enumerated value representative of the hour of a given week in which the impression served (based on the user’s timezone)
batch_id long eight-digit identifier of the batch that generated the file, of the format YYYYMediaMathDDNN where YYYYMediaMathDD is the processing date and NN is either 00, 01 or 02, corresponding to the first, second, and third batches of processed date each day
inventory_type_id integer
inventory_type string
homebiz_type_id integer also known as ‘connection Type’ in T1 Reports; values are either ‘business’ or ‘home’
homebiz_type string also known as ‘connection Type’ in T1 Reports; values are either ‘business’ or ‘home’
connected_id string NOTE: this column will only be populated with data if the Organization has additional agreements establish with MediaMath. Please contact your account representatives if you are interested in receiving data for this.
app_id string either App ID or Bundle ID of App to which impression is served, if present
viewability_event_id integer Metrics that are available to filter on:
1 = measurable impression (display)
2 = in view impression (display)
3 = 100% in view impression (display)
4 = in view 5 seconds impression (display)
5 = in view 15 seconds impression (display)
51 = measurable impression (video)
52 = viewable impression (video)
53 = 100% in view impression (video)
54 = in view 5 seconds impression (video)
55 = in view 15 seconds impression (video)
viewability_event_name string The string corresponding to the viewability_event_id.

Appendix - Day/Hour/Week Part Logic

NOTE: The below values should really only be used for Bring Your Own Algorithm integrations.

Day/hour/week part columns are generated from GMT timestamps using the below formulas, all based on week_hour_part (with values of 0 for Sunday 12:00 – 12:15am, through 671 for Saturday 11:45 – 11:59pm).

// 24 hours * 4 15-minute parts in an hour
day_of_week = (int) week_hour_part / 96;

// 7 days * 4 15-minute parts in an hour
day_hour = (int) week_hour_part / 28;

// 7 days * 4 parts * 6 hours in a day part
day_part = (int) week_hour_part / 168;

// 5 days * 4 parts * 24 hours
week_part = (week_hour_part < 480) ? 0 : 1;

// Check if it's after Friday then divide by 7 days
// times 4 hours.  Add 24 hours if over weekend
week_part_hour = (week_hour_part < 480) ? (int) week_hour_part / 28 : (int) (week_hour_part / 28) + 24;

// Check if it's after Friday then mod by 4
week_part_hour_part = (week_hour_part < 480) ? week_hour_part % 4 : (week_hour_part % 4) + 4;

// Straight mod by 4
hour_part = week_hour_part % 4;

// Divide by 4 parts then mod by 24 hours
week_hour = (int) (week_hour_part / 4) % 24;

Appendix - Batch ID Logic

Data platform data files for impressions and events are of the format:

/data/organization_id=[ORGANIZATION-ID]/[LOG-TYPE]_date=[YYYY-MM-DD]/mm_[LOG-TYPE]s_[ORGANIZATION-ID]_[YYYYMMDD]_[BATCH-ID]_[FILE-NUM].txt.lzo
  • LOG-TYPE: “impression” for impression log files, “event” for event log files
  • ORGANIZATION-ID: the six-digit TerminalOne organization ID
  • YYYY-MM-DD/YYYYMMDD: the GMT date of the data contained in the directory/file
  • BATCH-ID: the eight-digit identifier of the batch that generated the file, of the format YYYYMMDDNN where YYYYMMDD is the processing date and NN is either 00, 01 or 02, corresponding to the first, second, and third batches of processed date each day. Note that the date in the batch ID is not necessarily the date of the data in the files; for example, batch 2014070100 would be expected to contain a great deal of data both from 2014-06-31 and 2014-07-01, and would write impressions files both as:
    • impression_date=2014-06-31/mm_impressions_123456_20140631_2014070100_0000.txt.lzo
    • impression_date=2014-07-01/mm_impressions_123456_20140701_2014070100_0000.txt.lzo.
  • FILE-NUM: a particular batch may write many files for a single date. If the first batch on 2014-07-01 wrote, for organization 123456, two files of 2014-06-31 data and five files of 2014-07-01 data, the files would appear as:
    • impression_date=2014-06-31/mm_impressions_123456_20140631_2014070100_0000.txt.lzo
    • impression_date=2014-06-31/mm_impressions_123456_20140631_2014070100_0001.txt.lzo
    • impression_date=2014-07-01/mm_impressions_123456_20140701_2014070100_0000.txt.lzo
    • impression_date=2014-07-01/mm_impressions_123456_20140701_2014070100_0001.txt.lzo
    • impression_date=2014-07-01/mm_impressions_123456_20140701_2014070100_0002.txt.lzo
    • impression_date=2014-07-01/mm_impressions_123456_20140701_2014070100_0003.txt.lzo
    • impression_date=2014-07-01/mm_impressions_123456_20140701_2014070100_0004.txt.lzo

The file numbers are sequential but have no meaning otherwise; i.e., they do not represent a distribution of records by a particular campaign/creative/pixel, and are not sorted by time.