Billing
End of Month process:
Obtain ClientStats and ensure it is available for the previous month within:
stg_finance__billing_client_stats
Obtain ManualStats and ensure it is available for the previous month within:
stg_finance__delivered_manual_monthly
The process for #1 and #2 is described here: https://github.com/ozone-project/dbt/blob/master/ozone/data/maintain_seed_built_models.mdOnce both seed files are finalized and the related models have been updated, the billing stats must be re-published to include the above client & manual stats from the previous month.
Republishfct_back_office__billing_monthly_managed
&fct_back_office__billing_monthly
(fct_back_office__billing_monthly_programmatic
does not reference any of the client or manual data )
Data structure:
fct_back_office__billing_monthly_programmatic
: A collection of all 1st party data from the previous month, with all required levels of Revenue Calculations. The only addition is that Data Revenue calculations are made using the previous month’s data revenue share splits.fct_back_office__billing_monthly_managed
: Special consideration is given for Managed Lineitems and the special considerations made for any overdelivery past the booked revenue figure for that lineitem.fct_back_office__billing_monthly
: A final output which unions managed data with all other data from the programmatic table
Concepts
ClientStats are provided by external clients (advertisers) and collected (by AndyW) into a single file.
The billing of Managed Lineitems is focused on the data provided by clients. If Ozone overdelivers a lineitem, the client will not count that revenue and Ozone can not bill the client for it.Billable vs Delivered : Delivered_* fields are calculated by using Ozone’s own delivery data, while billable_* fields are calculated by:
Take ClientStats which subtracts any overdelivery
Review the ratio of delivery a publisher made for the lineitem in reality, and divide the client-provided stats by the ratio of delivery per publisher
Final ‘billable' revenue fields will attribute the revenue per publisher based on their share, but without any overdelivery accounted for
ManualStats are provided for any Lineitems which are not actually run through Ozone’s own pipelines. For example with “Skins” and related takeovers, adtags are provided to the publisher and they book those tags directly into their own Adserver. None of this data will show up in any Ozone delivery* tables.
The provided file allows for collecting this lineitem data from each publisher, and providing it in a summary file broken down by publisher, lineitem, and revenue code.Data Revenue & Distr Revenue calculations
Publishers within Ozone contribute data to the system which allows for targeting lineitems to Audiences/Segments. These publishers receive a kickback for the amount of traffic they have contributed to that segment for lineitems which delivered revenue against that segment.
At the end of the month, a summary of publisher shares per segment is made withinfct_publisher__monthly_billing_revenue
This is then used to calculate Data Revenue and Distr Revenue valuesCPCv
For CPCv campaigns, the revenue is already calculated within delivery_detailed to be the Salesforce ‘gross_price’ (minus AMV, Agency Fees, and Barter rates) multiplied by the number of completed views.
That value is stored in advertiser_delivered_net_revenue within delivery_detailed.
This impacts any Lineitem where the salesforce ‘metric’ field is set to “CPCv”
Important note: The other revenue columns (realtime + publisher revenues) are the actual bid prices that come in realtime during delivery, which are set based on CPM. These will not be changed for CPCv and can be referred to in order to see the actual bid prices versus the amount billed to advertisers.Levels of Revenue, calculations based on Revenue Code:
All levels of revenue are explained below, with reference taken from:
https://docs.google.com/spreadsheets/d/1ZJdVwx64tSAHmCJKQ6jm2j8Y0A0KAM0O7dMU648v4a4/edit#gid=1240779212
The main concept to be aware of is that traffic is being assigned a Revenue Code based on it’s seat_name, deal_id, and publisher.
Based on that revenue_code, we then know the ozone_fee and data_contribution percent which is used to calculate the levels of publisher revenues.
For Salesforce lineitems, we know the amv_percent which causes the difference for gross/net campaign prices.
Revenue Columns
Realtime Bid Revenues
ozone_delivered_gross_revenue (and ozone_delivered_gross_revenue_usd)
Gross bid revenue from Ozone Bidstream (Bid received from platform, before bid adjustment)
ozone_delivered_net_revenue (and ozone_delivered_net_revenue_usd)
Net bid revenue after bid adjustment from Ozone Bidstream (Bid sent to publisher adserver)
Baseline Revenues
delivered_gross_revenue
Campaign price, including AMV
For Managed, this is ozone_delivered_gross_revenue + amv_accrual
For Non-Managed, this is equal to ozone_delivered_gross_revenue
delivered_net_revenue
Campaign price, discounting AMV
For Managed, this is equal to ozone_delivered_gross_revenue
For Non-Managed, this is ozone_delivered_gross_revenue - amv_accrual
delivered_amv_accrual
delivered_gross_revenue * amv_percent
The calculated amount of AMV Accrual based on delivered_gross_revenue
Advertiser Revenues (estimated from delivery)
advertiser_delivered_net_revenue
Equal to delivered_gross_revenue (Campaign revenue, including AMV)
advertiser_delivered_agency_commission
delivered_gross_revenue / (1 - agency_commission) * agency_commission
The calculated agency commission amount
advertiser_delivered_barter_accrual
(delivered_gross_revenue + advertiser_delivered_agency_commission) * barter_percentage
The amount of barter accrued
advertiser_delivered_gross_revenue
ozone_delivered_gross_revenue + advertiser_delivered_agency_commission + advertiser_delivered_barter_accrual
The calculated Adveritser Gross revenue (Adveritser Net plus Agency Commission plus barter accrual
Publisher Revenues
publisher_delivered_gross_revenue
delivered_net_revenue
The publisher gross revenue, which equals delivered_net_revenue (No AMV included)
publisher_delivered_ozone_fee
delivered_net_revenue * ozone_fee
The calculated Ozone Fee based on gross bid received.
publisher_delivered_net_revenue
delivered_net_revenue * (1 - ozone_fee)
Publisher gross revenue minus Ozone Fee
publisher_delivered_data_accrual
(delivered_net_revenue * (1 - ozone_fee)) * data_contribution_percent
Calculated Data Accrual based on publisher net revenue
publisher_delivered_inventory_revenue
(delivered_net_revenue * (1 - ozone_fee)) * (1- data_contribution_percent)
Publisher net revenue minus data accrual
Calculated monthly:
publisher_delivered_data_revenue
publisher_delivered_data_accrual * audience_segment_share * data_revenue_share
+
publisher_delivered_data_accrual * (1 - audience_segment_share)
Contextual & Audience data revenue calculations
publisher_delivered_distr_revenue
publisher_delivered_inventory_revenue + publisher_delivered_data_revenue
Final monthly revenue of a Publisher with AMV, ozone_fees & data accrual removed, and data_revenue added back in.
- style