Basis of Presentation and Summary of Significant Accounting Policies | Note 2—Basis of Presentation and Summary of Significant Accounting Policies Basis of Presentation and Principles of Consolidation The accompanying consolidated financial statements are prepared in accordance with accounting principles generally accepted in the United States of America (“GAAP”) and include the operations of the Company and its wholly owned subsidiaries. All intercompany transactions have been eliminated in consolidation. The Company has no components of other comprehensive income (loss), and accordingly, the Company’s comprehensive income is the same as its net income for all periods presented. Use of Estimates The preparation of consolidated financial statements in conformity with GAAP requires management to make estimates and assumptions that affect the reported amounts of assets and liabilities and disclosures of contingent assets and liabilities at the date of the consolidated financial statements and the reported amounts of revenue and expenses during the reporting period. Actual results could differ materially from these estimates. On an on-going basis, management evaluates its estimates, primarily those related to: (1) revenue recognition criteria, including the determination of revenue reporting as net versus gross in the Company’s revenue arrangements, (2) allowances for doubtful accounts, (3) the useful lives of property and equipment and capitalized software development costs, (4) income taxes, (5) assumptions used in the Black-Scholes option pricing model to determine the fair value of stock-based compensation, (6) the recognition and disclosure of contingent liabilities and (7) the assumptions used in valuing acquired assets and assumed liabilities in business combinations Revenue Recognition On January 1, 2018, the Company adopted Accounting Standards Update (“ASU”) No. 2014-09, Revenue from Contracts with Customers (Topic 606) The Company determines revenue recognition through the following steps: • Identification of a contract with a customer; • Identification of the performance obligations in the contract; • Determination of the transaction price; • Allocation of the transaction price to the performance obligations in the contract; and • Recognition of revenue when or as the performance obligations are satisfied. The Company maintains agreements with each client and supplier in the form of master service agreements, which set out the terms of the relationship and access to the Company’s platform. The Company’s performance obligation is to provide the use of its platform to clients to develop ad campaigns and select the advertising inventory, data and other add-on features. The Company charges clients a platform fee, based on a percentage of a client’s purchases through the platform, and the transaction price is determined based on the consideration to which it expects to be entitled in exchange for the completion of a transaction, that is, when a bid is won. The Company reports revenue net of amounts it pays suppliers for the cost of advertising inventory, third-party data and other add-on features (collectively, “Supplier Features”). The determination of whether the Company is the principal or agent, and hence whether to report revenue on a gross basis for the amount of the Supplier Features the clients purchase using the platform plus the Company’s platform fees or on a net basis for the amount of platform fees charged to the client, requires judgment. The Company determined that it is not primarily responsible for the purchase of Supplier Features, but rather, it is primarily responsible to provide a platform that enables clients to bid on advertising inventory, and use data and other add-on features in designing and executing their campaigns. The Company does not control the Supplier Features prior to the purchase by the client, and it does not have pricing latitude with respect to the cost of such features. The platform fee the Company charges clients is a percentage of their purchases through its platform, similar to a commission, and the platform fee is not contingent on the results of an advertising campaign. Based on these and other factors, the Company determined that it is not the principal in the purchase and sale of Supplier Features in all of its arrangements, and therefore, it reports revenue on a net basis for the platform fees charged to clients. The Company generally bills clients for the gross amount of Supplier Features they purchase through its platform and the platform fees, net of allowances (“Gross Billings”). Some of the Company’s clients have payment relationships directly with advertising inventory suppliers in which case the Company only bills these clients for third-party data, other add-on features and its platform fees. The Company invoices its clients on a monthly basis for the purchases occurring during the month. Invoice payment terms, negotiated on a client-by-client basis, are typically between 30 to 90 days. However, for certain agency clients with sequential liability terms, payments are not due to the Company until such agency client has received payment from its customers who are advertisers. The Company’s accounts receivable are recorded at the amount of Gross Billings for the amounts it is responsible to collect, and accounts payable are recorded at the net amount payable to suppliers. Accordingly, both accounts receivable and accounts payable appear large in relation to revenue reported on a net basis. Refer to Note 11 for geographic information related to Gross Billings. Operating Expenses The Company classifies its operating expenses into four categories: Platform Operations. Platform operations expense consists of expenses related to hosting the Company’s platform, which includes “internet traffic” associated with the viewing of available impressions or queries per second (QPS) and providing support to clients. Platform operations expense includes hosting costs, personnel costs, and amortization of acquired technology and capitalized software costs for the development of the Company’s platform, including allocated overhead. Personnel costs included in platform operations include salaries, bonuses, stock-based compensation, and employee benefit costs, and are primarily attributable to personnel who provide the Company’s clients with support using the Company’s platform and the personnel who support the Company’s platform. The Company capitalizes certain costs associated with the development of the Company’s platform and amortizes these costs over their estimated useful lives in platform operations expense. The Company allocates overhead such as information technology infrastructure, rent and occupancy charges based on headcount. Sales and Marketing. Sales and marketing expense consists primarily of personnel costs, including salaries, bonuses, stock-based compensation, employee benefits costs and commission costs, for the Company’s sales and marketing personnel. Sales and marketing expense also includes costs for market development programs, advertising, promotional and other marketing activities, and allocated overhead. The Company allocates overhead such as information technology infrastructure, rent and occupancy charges based on headcount. Commissions costs are expensed as incurred. Technology and Development. The Company’s technology and development expense consists primarily of personnel costs, including salaries, bonuses, stock-based compensation and employee benefits costs, third-party consultant costs associated with the ongoing development and maintenance of the Company’s platform and integrations with our advertising and data inventory suppliers, amortization of capitalized third-party software used in the development of the Company’s platform and allocated overhead. The Company allocates overhead such as information technology infrastructure, rent and occupancy charges based on headcount. Technology and development costs are expensed as incurred, except to the extent that such costs are associated with software development that qualifies for capitalization, which are then recorded as capitalized software development costs included in other assets, non-current on the Company’s consolidated balance sheet. The Company amortizes capitalized software development costs relating to the Company’s platform to platform operations expense. General and Administrative. The Company’s general and administrative expense consists primarily of personnel costs, including salaries, bonuses, stock-based compensation, and employee benefits costs associated with the Company’s executive, finance, legal, human resources, compliance, and other administrative personnel, as well as accounting and legal professional services fees, bad debt expense and allocated overhead. The Company allocates overhead such as information technology infrastructure, rent and occupancy charges based on headcount. Stock-Based Compensation Compensation expense related to stock options, restricted stock awards and units, which are referred to collectively as restricted stock, and awards granted under the Company’s employee stock purchase plan (“ESPP”), is measured and recognized in the consolidated financial statements based on the fair value of the awards granted. The fair value of each option award is estimated on the grant date using the Black-Scholes option-pricing model. The fair value of restricted stock is calculated using the closing market price of the Company’s common stock on the date of grant, and for performance-based restricted stock, we also assess the probability of targets being achieved in determining the amount of expense to recognize. Stock-based compensation expense related to stock options and restricted stock is recognized on a straight-line basis over the requisite service periods of the awards, which is generally four years. For performance-based restricted stock, expense is recognized on a graded-vesting attribution basis over the requisite service period of the award and is adjusted in subsequent reporting periods if the assessed probability or estimated level of achievement of the performance goals changes. Stock-based compensation expense for ESPP awards is recognized on a graded-vesting attribution basis over the requisite service period of each award. Determining the fair value of stock options and ESPP awards requires judgment. The Company’s use of the Black-Scholes option pricing model requires the input of subjective assumptions, including the fair value of the underlying common stock for periods prior to the completion of the Company’s IPO in September 2016, the expected term of the option, the expected volatility of the Company’s common stock, risk-free interest rates, and the expected dividend yield of the Company’s common stock. The assumptions used in the Company’s option-pricing model represent management’s best estimates. These estimates involve inherent uncertainties and the application of management’s judgment. These assumptions and estimates are as follows: Fair Value of Common Stock. For stock options granted subsequent to the Company’s IPO in September 2016 and ESPP awards, the fair value of common stock is based on the closing price of its common stock as reported on the NASDAQ Global Market on the grant date. Prior to the IPO in September 2016, the board of directors determined the fair value of the common stock at the time of the grant of options by considering a number of objective and subjective factors including the Company’s actual operating and financial performance, market conditions and performance of comparable publicly traded companies, developments and milestones in the Company, the likelihood of achieving a liquidity event and transactions involving the Company’s preferred or common stock, among other factors. The fair value was determined in accordance with applicable elements of the practice aid issued by the American Institute of Certified Public Accountants, . Risk The risk-free interest rate is based on the yields of U.S. Treasury securities with maturities approximating the expected term of the awards. Expected Term. Given insufficient historical data relating to stock option exercises, to determine the expected term, the Company applies the simplified approach, in which the expected term of an award is presumed to be the mid-point between the vesting date and the expiration date of the award. For ESPP awards, the expected term is the time period from the grant date to the respective purchase dates included within each offering period. Volatility. Because the Company has a short trading history for its common stock, the Company determines the price volatility based on a blend of the historical volatilities of a publicly traded peer group, implied volatilities from its traded options, and its historical volatility, based on daily price observations over a period equivalent to the expected term of the award. Dividend Yield. The dividend yield assumption is based on the Company’s history and current expectations of dividend payouts. The Company has never declared or paid any cash dividends on its common stock and does not anticipate paying any cash dividends in the foreseeable future, so the Company used an expected dividend yield of zero. During the year ended December 31, 2016, the Company early adopted Accounting Standards Update (“ASU”) No. 2016-09, Compensation—Stock Compensation (Topic 718): Improvements to Employee Share—Based Payment Accounting The Company will continue to use judgment in evaluating the assumptions related to the Company’s stock-based compensation. Future expense amounts for any particular period could be affected by changes in the Company’s assumptions or market conditions. Income Taxes Deferred income tax assets and liabilities are determined based upon the net tax effects of the differences between the Company’s consolidated financial statements carrying amounts and the tax basis of assets and liabilities and are measured using the enacted tax rate expected to apply to taxable income in the years in which the differences are expected to be reversed. A valuation allowance is used to reduce some or all of the deferred tax assets if, based upon the weight of available evidence, it is more likely than not that those deferred tax assets will not be realized. The Company recognizes the tax benefit from an uncertain tax position only if it is more likely than not that the tax position will be sustained on examination by the taxing authorities, based on the technical merits of the position. The tax benefits recognized in the consolidated financial statements from such positions are then measured based on the largest benefit that has a greater than 50% likelihood of being realized. The Company recognizes interest and penalties accrued related to its uncertain tax positions in its income tax provision in the accompanying consolidated statements of operations. In January 2018, the FASB released guidance on the accounting for tax on the global intangible low-taxed income ("GILTI") provisions of the Tax Cuts and Jobs Act (the "Act"). The GILTI provisions impose a tax on foreign income in excess of a deemed return on tangible assets of foreign corporations. The guidance indicates that either accounting for deferred taxes related to GILTI inclusions or to treat any taxes on GILTI inclusions as period cost are both acceptable methods subject to an accounting policy election. Effective the first quarter of 2018, the Company elected to treat any potential GILTI inclusions as a period cost. Net Income (Loss) Per Share Attributable to Common Stockholders Basic net income (loss) per share attributable to common stockholders is calculated by dividing the net income (loss) attributable to common stockholders by the weighted-average number of shares of common stock outstanding. The Company applies the two-class method to allocate net income (loss) between common and other participating securities based on their participation rights. Prior to the conversion of preferred stock to common stock concurrent with the IPO in September 2016 and because the holders of the Company’s convertible preferred stock were entitled to participate in dividends, the Company allocated net income to common and preferred stock based on their respective rights to receive dividends, whether or not declared. For 2016, the excess of the repurchase price of preferred stock over its carrying value has been recorded as a reduction to net income to determine net loss attributable to common stockholders. Diluted net income (loss) per share attributable to common stockholders adjusts the basic net income (loss) per share attributable to common stockholders and the weighted-average number of shares of common stock outstanding for the potentially dilutive impact of stock options, restricted stock, ESPP and warrants, using the treasury-stock method, and convertible preferred stock using the as-if-converted method. Cash, Cash Equivalents and Marketable Securities The Company considers all short-term highly liquid investments with an original maturity of three months or less to be cash equivalents. Cash equivalents, consisting of money market funds and time deposits, are carried at fair value. Refer to Note 6—Fair Value Measurements for additional information regarding the fair value of cash equivalents. Subsequent to December 31, 2018, the Company used existing cash and cash equivalents to purchase $50.9 million in marketable securities classified as short-term investments. The Company classifies its marketable securities as available-for-sale investments in its current assets because they represent investments of cash available for current operations. Available-for-sale investments are carried at fair value with any unrealized gains and losses, net of taxes, included in accumulated other comprehensive income (loss) in stockholders' equity. Unrealized losses are charged against other expense when a decline in fair value is determined to be other-than-temporary. The Company determines realized gains or losses on sale of marketable securities on a specific identification method, and records such gains or losses as other expense (income). Accounts Receivable and Allowance for Doubtful Accounts Accounts receivable are recorded at the invoiced amount, are unsecured and do not bear interest. The Company performs ongoing credit evaluations of its clients and certain advertisers when the Company’s agreements with its clients contain sequential liability terms that provide that the client payments are not due to the Company until the client has received payment from its customers who are advertisers. The allowance for doubtful accounts is based on the best estimate of the amount of probable credit losses in existing accounts receivable. The allowance for doubtful accounts is determined based on historical collection experience and the review in each period of the status of the then-outstanding accounts receivable, while taking into consideration current client information, subsequent collection history and other relevant data. The Company reviews the allowance for doubtful accounts on a quarterly basis. Account balances are charged off against the allowance when the Company believes it is probable the receivable will not be recovered. The following table presents changes in the allowance for doubtful accounts (in thousands): Year Ended December 31, 2018 2017 2016 Beginning balance $ 2,257 $ 2,574 $ 686 Add: bad debt expense 2,115 4,289 1,890 Less: write-offs, net of recoveries (1,399 ) (4,606 ) (2 ) Ending balance $ 2,973 $ 2,257 $ 2,574 Property and Equipment, Net Property and equipment are recorded at historical cost, less accumulated depreciation and amortization. Depreciation is computed using the straight-line method based upon the following estimated useful lives: Years Computer equipment 2 – 3 Purchased software 3 – 5 Furniture, fixtures and office equipment 5 Leasehold improvements * * Leasehold improvements are amortized on a straight-line basis over the term of the lease, or the useful life of the assets, whichever is shorter. Repair and maintenance costs are charged to expense as incurred, while renewals and improvements are capitalized. When assets are retired or otherwise disposed of, the cost and related accumulated depreciation are removed from the accounts and any resulting gain or loss is reflected in the Company’s operating results. Capitalized Software Development Costs The Company capitalizes certain costs associated with creating and enhancing internally developed software related to the Company’s technology infrastructure. These costs include personnel and related employee benefits expenses for employees who are directly associated with and who devote time to software development projects, and external direct costs of materials and services consumed in developing or obtaining the software. Software development costs that do not qualify for capitalization, as further discussed below, are expensed as incurred and recorded in technology and development expenses in the consolidated statements of operations. Software development activities typically consist of three stages: (1) the planning phase; (2) the application and infrastructure development stage; and (3) the post implementation stage. Costs incurred in the planning and post implementation phases, including costs associated with the post-configuration training and repairs and maintenance of the developed technologies, are expensed as incurred. The Company capitalizes costs associated with software developed when the preliminary project stage is completed, management implicitly or explicitly authorizes and commits to funding the project and it is probable that the project will be completed and perform as intended. Costs incurred in the application and infrastructure development phases, including significant enhancements and upgrades, are capitalized. Capitalization ends once a project is substantially complete and the software is ready for its intended purpose. Software development costs are amortized using a straight-line method over the estimated useful life of two years, commencing when the software is ready for its intended use. The straight-line recognition method approximates the manner in which the expected benefit will be derived. The Company does not transfer ownership of its internally developed software, or lease its software, to third parties. On July 1, 2018, the Company early adopted ASU No. 2018-15, Intangibles-Goodwill and Other-Internal-Use Software (Subtopic 350-40): Customer's Accounting for Implementation Costs Incurred in a Cloud Computing Arrangement That is a Service Contract , using the prospective method. ASU 2018-15 aligns the requirements for capitalizing implementation costs incurred in a hosting arrangement that is a service contract with the requirements for capitalizing implementation costs incurred to develop or obtain internal-use software. Previously, all implementation costs for a hosting arrangement that was a service contract were expensed when incurred. Cloud computing arrangements (“CCAs”), such as software as a service and other hosting arrangements, are evaluated for capitalized implementation costs in a similar manner as capitalized software development costs. If a CCA includes a software license, the software license element of the arrangement is accounted for in a manner consistent with the acquisition of other software licenses. If a CCA does not include a software license, the service element of the arrangement is accounted for as a service contract. The Company capitalized certain implementation costs for its CCAs that are service contracts totaling $0.9 million during 2018, which are included in . The Company amortizes capitalized implementation costs in a CCA over the life of the service contract. During 2018, the amortization of these capitalized implementation costs was immaterial. Business Combinations The results of a business acquired in a business combination are included in the Company’s consolidated financial statements from the date of the acquisition. Purchase accounting results in assets and liabilities of an acquired business generally being recorded at their estimated fair values on the acquisition date. Any excess consideration over the fair value of assets acquired and liabilities assumed is recognized as goodwill. Transaction costs associated with business combinations are expensed as incurred and are included in general and administrative expenses in the consolidated statements of operations. The Company performs valuations of assets acquired and liabilities assumed and allocates the purchase price to its respective assets and liabilities. Determining the fair value of assets acquired and liabilities assumed may require management to use significant judgment and estimates, including the selection of valuation methodologies, estimates of future revenue, costs and cash flows, discount rates, and selection of comparable companies. The Company engages the assistance of valuation specialists in concluding on fair value measurements in connection with determining fair values of assets acquired and liabilities assumed in a business combination. In October 2017, the Company paid $3.0 million in cash for certain assets of a data company accounted for as a business combination. These assets primarily consisted of acquired technology and goodwill which are included in other assets, non-current. Operating Leases The Company records rent expense for operating leases, some of which have escalating rent payments, on a straight-line basis over the lease term. The Company begins recognition of rent expense on the date of initial possession, which is generally when the Company enters the leased premises and begins to make improvements in preparation for its intended use. Some of the Company’s lease arrangements provide for concessions by the landlords, including payments for leasehold improvements and rent-free periods. The Company accounts for the difference between the straight-line rent expense and rent paid as deferred rent. Refer to the discussion below in Recent Accounting Pronouncements regarding the Company’s adoption of ASU No. 2016-02, Leases Debt Issuance Costs Debt issuance costs related to the term loans have been recorded as a reduction of the carrying amount of the debt and are amortized to interest expense using the effective interest method. Debt financing costs associated with credit facilities have been deferred and recorded in other assets, non-current and are amortized to interest expense on a straight-line basis over the term of the credit facilities. Preferred Stock Warrant Liabilities Prior to the completion of the Company’s IPO in September 2016, warrants to purchase preferred stock of the Company were accounted for as liabilities at fair value because the underlying shares of convertible preferred stock were contingently redeemable, including in the case of a deemed liquidation, which could have obligated the Company to transfer assets to the preferred stockholders. The preferred stock warrants were recorded at fair value at each balance sheet date and changes in the fair value of the preferred stock warrants during each reporting period were recorded in the Company’s consolidated statements of operations until the earlier of the exercise or expiration of the warrants or the warrants’ conversion to warrants to purchase common stock, at which time any remaining liability was reclassified to additional paid-in capital. Immediately prior to the completion of the Company’s IPO in September 2016, all of the Company’s then-outstanding convertible preferred stock warrants were remeasured to fair value and automatically converted and reclassified into Class B common stock warrants and all remaining warrants were net exercised. Fair Value of Financial Instruments Fair value is defined as the exchange price that would be received for an asset or paid to transfer a liability (an exit price) in the principal or most advantageous market for the asset or liability in an orderly transaction between market participants on the measurement date. Valuation techniques used to measure fair value must maximize the use of observable inputs and minimize the use of unobservable inputs. Fair value measurements are based on a fair value hierarchy, based on three levels of inputs, of which the first two are considered observable and the last unobservable, which are the following: Level 1—Quoted prices (unadjusted) in active markets for identical assets or liabilities that the Company has the ability to access at the measurement date. Level 2—Inputs other than quoted prices included within Level 1 that are observable for the asset or liability, either directly or indirectly, such as quoted market prices for similar assets and liabilities; quoted prices in markets that are not active; or other inputs that are observable or can be corroborated by observable market data for substantially the full term of the asset or liability. Level 3—Unobservable inputs. Observable inputs are based on market data obtained from independent sources. The carrying amounts of accounts receivable, accounts payable, accrued expenses and other current liabilities approximate fair value due to the short-term nature of these instruments. The carrying value of the line of credit and term loans approximates fair value based on borrowing rates currently available to the Company for financing with similar terms and were determined to be Level 2. The Company’s convertible preferred stock warrants were measured using unobservable inputs that required a high level of judgment to determine fair value, and were thus classified as Level 3. Certain long lived assets including capitalized software development costs are also subject to measurement at fair value on a non-recurring basis if they are deemed to be impaired as a result of an impairment review. To date, no material impairments have been recorded on those assets. Concentration of Risk Financial instruments that potentially subject the Company to concentration of credit risk consist principally of cash and cash equivalents, marketable securities and accounts receivable. The Company maintains its cash and cash equivalents with financial institutions and its cash levels exceed the Federal Deposit Insurance Corporation (FDIC) federally insured limits. Marketable securities consist of investments in U.S. government securities, U.S. government agency securities, and high credit quality corporate debt securities. For 2018, two clients accounted for 20% and 10%, respectively, of Gross Billings. For 2017, three clients accounted for 22%, 11% and 10%, respectively, of Gross Billings. For 2016, three clients accounted for 15%, 13% and 11%, respectively, of Gross Billings. As of December 31, 2018, two clients accounted for 24% and 14%, respectively, of consolidated accounts receivable. As of December 31, 2017, three clients accounted for 33%, 14% and 11%, respectively, of consolidated accounts receivable. As of December 31, 2018, no suppliers accounted for more than 10% of consolidated accounts payable. As of December 31, 2017, one supplier accounted for 12% of consolidated accounts payable. Foreign Currency Transactions and Translation The Company has entities operating in various countries. Each of these entities’ functional currency is the U.S. Dollar. Transactions in foreign currencies are translated into U.S. Dollars at the rates of exchange in effect at the date of the transaction. Net transaction losses were approximately $1.9 million, $4.0 million, and $1.2 million for the years ended December 31, 2018, 2017 and 2016, respectively, and are included in foreign currency exchange loss, net in the accompanying consolidated statements of operations. The Company enters into forward contracts to hedge foreign currency exposures related primarily to the Company’s foreign currency denominated accounts receivable. The Company does not designate the foreign exchange forward contracts as hedges for accounting purposes and changes in the fair value of the foreign exchange forward contracts are recorded in foreign currency exchange loss, net in the accompanying consolidated statements of operations. As of December 31, 2018 and 2017, the Company had open forward contracts with aggregate notional amounts of $78.8 million and $58.4 million, respectively. The fair value of the open forward contracts was not material. The Company’s forward contracts generally have terms of 30-60 days. Recent Accounting Pronouncements In February 2016, the FASB issued ASU No. |