Summary of Significant Accounting Policies | Summary of Significant Accounting Policies Segment Information The Company operates in a single operating segment. The Company’s chief operating decision maker is its chief executive officer, who reviews financial information presented on a consolidated basis for purposes of making operating decisions, assessing financial performance and allocating resources. Revenue Recognition The Company derives revenue from subscription fees (which include support fees) and professional services fees. The Company sells subscriptions to its platform through arrangements that are generally one to five years in length. The Company’s arrangements are generally noncancelable and nonrefundable. Furthermore, if a customer reduces the contracted usage or service level, the customer has no right of refund. The Company’s subscription arrangements do not provide customers with the right to take possession of the software supporting the platform and, as a result, are accounted for as service arrangements. This revenue recognition policy is consistent for sales generated directly with customers and sales generated indirectly through channel partners. The Company determines revenue recognition through the following steps: • Identification of the contract, or contracts, 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 Company satisfies a performance obligation. Subscription Revenue Subscription revenue, which includes support, is recognized on a straight-line basis over the noncancelable contractual term of the arrangement, generally beginning on the date that the Company’s service is made available to the customer. Professional Services Revenue The Company’s professional services principally consist of customer-specific requests for application integrations, user interface enhancements and other customer-specific requests. Revenue for the Company’s professional services is recognized as services are performed in proportion to their pattern of transfer. Contracts with Multiple Performance Obligations Some of the Company’s contracts with customers contain multiple performance obligations. For these contracts, the Company accounts for individual performance obligations separately if they are distinct. The transaction price is allocated to the separate performance obligations on a relative SSP basis. The Company determines SSP based on observable, if available, prices for those related services when sold separately. When such observable prices are not available, the Company determines SSP based on overarching pricing objectives and strategies, taking into consideration market conditions and other factors, including customer size, volume purchased, market and industry conditions, product-specific factors and historical sales of the deliverables. Deferred Revenue Deferred revenue consists of customer billings in advance of revenue being recognized from the Company’s subscription and support services and professional services arrangements. The Company primarily invoices its customers for its subscription services arrangements annually in advance. The Company’s payment terms generally provide that customers pay the invoiced portion of the total arrangement fee within 30 days of the invoice date. Amounts anticipated to be recognized within one year of the balance sheet date are recorded as deferred revenue, current; the remaining portion is recorded as deferred revenue, noncurrent in the consolidated balance sheets. Deferred Commissions Sales commissions earned by the Company’s sales force are considered incremental and recoverable costs of obtaining a contract with a customer. Sales commissions for new revenue contracts, including incremental sales to existing customers, are deferred and then amortized on a straight-line basis over a period of benefit, which the Company has determined to be generally five years. The Company determined the period of benefit by taking into consideration its customer contracts, its technology and other factors. Sales commissions for renewal contracts (which are not considered commensurate with sales commissions for new revenue contracts and incremental sales to existing customers) are deferred and then amortized on a straight-line basis over the related period of benefit, which is generally the related contract renewal term. Amortization expense is included in sales and marketing expenses in the accompanying consolidated statements of operations. Sales commissions capitalized as contract costs totaled $41.3 million and $27.0 million in the years ended January 31, 2019 and 2018 , respectively. Amortization of contract costs was $20.9 million , $15.2 million and $10.5 million for the years ended January 31, 2019 , 2018 and 2017 , respectively. There was no impairment loss in relation to the costs capitalized. Cost of Revenue Costs of revenue primarily consist of costs related to providing the Company’s cloud-based platform to its customers, including third-party hosting fees, amortization of capitalized internal-use software and finite-lived purchased developed technology, customer support, other employee-related expenses for security, technical operations and professional services staff, and allocated overhead costs. Cash, Cash Equivalents and Restricted Cash Cash and cash equivalents consist of cash on hand and highly liquid investments with original maturities of three months or less from the date of purchase. Cash equivalents generally consist of investments in money market funds. The fair market value of cash equivalents approximated their carrying value as of January 31, 2019 and 2018 . As of January 31, 2019 and 2018 , the Company's long-term restricted cash balance was $11.4 million and $8.3 million , respectively, related to letters of credit for its facility lease agreements. Long-term restricted cash is included within other assets on the Company's consolidated balance sheet. Short-term Investments The Company’s short-term investments comprise asset-backed securities, U.S. treasury securities and corporate debt securities. The Company determines the appropriate classification of its short-term investments at the time of purchase and reevaluates such designation at each balance sheet date. The Company has classified and accounted for its short-term investments as available-for-sale securities as the Company may sell these securities at any time for use in its current operations or for other purposes, even prior to maturity. As a result, the Company classifies its short-term investments, including securities with stated maturities beyond twelve months, within current assets in the consolidated balance sheets. Available-for-sale securities are recorded at fair value each reporting period. Unrealized gains and losses on these short-term investments are reported as a separate component of accumulated other comprehensive loss in the consolidated balance sheets until realized. Interest income is reported within other income (expense), net in the consolidated statements of operations. The Company periodically evaluates its short-term investments to assess whether those with unrealized loss positions are other-than-temporarily impaired. The Company considers various factors in determining whether to recognize an impairment charge, including the length of time the investment has been in a loss position, the extent to which the fair value is less than the Company’s cost basis, the investment’s financial condition and near-term prospects of the investee. Realized gains and losses are determined based on the specific identification method and are reported in other income (expense), net in the consolidated statements of operations. If the Company determines that the decline in an investment’s fair value is other-than-temporary, the difference is recognized as an impairment loss in the consolidated statements of operations. Accounts Receivable and Allowances Accounts receivable are recorded at the invoiced amount, net of allowances. These allowances are based on the Company’s assessment of the collectibility of accounts by considering the age of each outstanding invoice, the collection history of each customer and an evaluation of potential risk of loss associated with delinquent accounts. Amounts deemed uncollectible are recorded to these allowances in the consolidated balance sheets with an offsetting decrease in related deferred revenue and a charge to general and administrative expense in the consolidated statement of operations. Property and Equipment Property and equipment, net, is stated at cost less accumulated depreciation. Depreciation is recorded using the straight-line method over the estimated useful lives of the respective assets. Repairs and maintenance costs are expensed as incurred. The useful lives of property and equipment are as follows: Useful lives Capitalized internal-use software costs 3 years Computers and equipment 3 years Furniture and fixtures 7 years Leasehold improvements Shorter of estimated useful life or remaining lease term Capitalized Internal-Use Software Costs The Company capitalizes as intangible assets certain costs incurred during the application development stage in connection with software development for its platform. Costs related to preliminary project activities and post-implementation activities are expensed as incurred. Capitalized costs are recorded as part of intangible assets. Maintenance and training costs are expensed as incurred. Capitalized internal-use software costs are amortized on a straight-line basis over the software’s estimated useful life, which is generally three years . The Company records amortization related to capitalized internal-use software within subscription cost of revenue in the consolidated statements of operations. The Company evaluates the useful lives of these assets on an annual basis and tests for impairment whenever events or changes in circumstances occur that could impact the recoverability of these assets. Business Combinations When the Company acquires a business, the purchase price is allocated to the net tangible and identifiable intangible assets acquired. Any residual purchase price is recorded as goodwill. The allocation of the purchase price requires management to make estimates in determining the fair values of assets acquired and liabilities assumed, especially with respect to intangible assets. These estimates can include, but are not limited to, the cash flows that an asset is expected to generate in the future, the appropriate weighted-average cost of capital and the cost savings expected to be derived from acquiring an asset. These estimates are inherently uncertain and unpredictable. During the measurement period, which may be up to one year from the acquisition date, adjustments to the fair value of these tangible and intangible assets acquired and liabilities assumed may be recorded, with the corresponding offset to goodwill. Upon the conclusion of the measurement period or final determination of the fair value of assets acquired or liabilities assumed, whichever comes first, any subsequent adjustments are recorded to the consolidated statements of operations. Goodwill and Other Long-Lived Assets The excess of the purchase price over the estimated fair value of net assets of businesses acquired in a business combination is recognized as goodwill. Goodwill is tested for impairment annually on November 1 st or more frequently if certain indicators are present. Long-lived assets, such as property and equipment and finite-lived intangible assets subject to amortization are reviewed for impairment whenever events or changes in circumstances indicate that the carrying amount of any asset may not be recoverable. Recoverability of assets to be held and used is measured by comparing the carrying amount to the estimated undiscounted future cash flows expected to be generated. If the carrying amount exceeds the undiscounted cash flows, the assets are determined to be impaired and an impairment charge is recognized as the amount by which the carrying amount exceeds its fair value. The Company amortizes intangible assets with finite lives on a straight-line basis over their estimated useful lives in cost of revenue in the consolidated statements of operations. Convertible Senior Notes The 2023 Notes are accounted for in accordance with FASB ASC Subtopic 470‑20, Debt with Conversion and Other Options. Pursuant to ASC Subtopic 470‑20, issuers of certain convertible debt instruments, such as the 2023 Notes, that have a net settlement feature and may be settled wholly or partially in cash upon conversion are required to separately account for the liability (debt) and equity (conversion option) components of the instrument. The carrying amount of the liability component of the instrument is computed by estimating the fair value of a similar liability without the conversion option. The amount of the equity component is then calculated by deducting the fair value of the liability component from the principal amount of the instrument. The difference between the principal amount and the liability component represents a debt discount that is amortized to interest expense over the respective term of the 2023 Notes using the effective interest rate method. The equity component is not remeasured as long as it continues to meet the conditions for equity classification. In accounting for the issuance costs related to the 2023 Notes, the allocation of issuance costs incurred between the liability and equity components was based on their relative values. Advertising Expenses Advertising costs are expensed as incurred. Advertising expense was $10.0 million , $9.4 million , and $4.4 million for the years ended January 31, 2019 , 2018 and 2017 . Stock-Based Compensation Stock-based compensation issued to employees and non-employees, including the purchase rights issued under the Company's 2017 Employee Stock Purchase Plan (ESPP), is measured based on the grant-date fair value of the awards and recognized as an expense following the straight-line attribution method over the requisite service period for stock options, restricted stock units (RSUs) and restricted stock, and over the offering period for the purchase rights issued under the ESPP. The Company’s use of the Black-Scholes option-pricing model to estimate the fair value of stock options granted requires the input of highly subjective assumptions. These assumptions and estimates are as follows: Fair value — Prior to the IPO, the Company's stock was not publicly traded and it estimated the fair value of common stock using various methodologies, including valuation analyses performed by third-party valuation firms. After the IPO, the Company used the publicly quoted price as reported on the Nasdaq Global Select Market as the fair value of its common stock. Expected volatility — Expected volatility is a measure of the amount by which the stock price is expected to fluctuate. Since the Company does not have sufficient trading history of its common stock, it estimates the expected volatility of its stock options at their grant date by taking the weighted-average historical volatility of a group of comparable publicly-traded companies over a period equal to the expected life of the options. Expected term — The Company determines the expected term based on the average period the stock options are expected to remain outstanding, generally calculated as the midpoint of the stock option’s vesting term and contractual expiration period, as the Company does not have sufficient historical information to develop reasonable expectations about future exercise patterns and post-vesting employment termination behavior. Risk-free rate — The Company uses the U.S. Treasury yield that corresponds with the expected term. Expected dividend yield — The Company utilizes a dividend yield of zero , as it does not currently issue dividends and does not expect to in the future. Income Taxes The Company accounts for income taxes in accordance with the liability method of accounting for income taxes. Under this method, the Company recognizes deferred tax assets and liabilities for the expected future tax consequences of temporary differences between the financial reporting and tax basis of assets and liabilities, as well as for operating loss and tax credit carryforwards. Deferred tax assets and liabilities are measured using enacted tax rates that are expected to apply to taxable income for the years in which those tax assets and liabilities are expected to be realized or settled. The Company records a valuation allowance to reduce its deferred tax assets to the net amount that the Company believes is more likely than not to be realized. In assessing the need for a valuation allowance, the Company has considered its historical levels of income, expectations of future taxable income and ongoing tax planning strategies. Because of the uncertainty of the realization of the deferred tax assets, the Company has recorded a full valuation allowance against its deferred tax assets. Realization of its deferred tax assets is dependent primarily upon future U.S. taxable income. The Company recognizes and measures tax benefits from uncertain tax positions using a two-step approach. The first step is to evaluate the tax position taken or expected to be taken by determining if the weight of available evidence indicates that it is more likely than not that the tax position will be sustained in an audit, including resolution of any related appeals or litigation processes. The second step is to measure the tax benefit as the largest amount that is more than 50% likely to be realized upon ultimate settlement. Significant judgment is required to evaluate uncertain tax positions. Although the Company believes that it has adequately reserved for its uncertain tax positions, it can provide no assurance that the final tax outcome of these matters will not be materially different. The Company evaluates its uncertain tax position on a regular basis and evaluations are based on a number of factors, including changes in facts and circumstances, changes in tax law, correspondence with tax authorities during the course of an audit and effective settlement of audit issues. To the extent that the final tax outcome of these matters is different than the amounts recorded, such differences will affect the provision for income taxes in the period in which such determination is made and could have a material impact on the Company’s financial condition and results of operations. The provision for income taxes includes the effects of any accruals that the Company believes are appropriate, as well as the related net interest and penalties. Facility Leases Certain facility lease agreements contain rent holidays, allowances and rent escalation provisions. For these leases, the Company recognizes the related rental expense on a straight-line basis over the lease period of the facility and records the difference between amounts charged to operations and amounts paid as deferred rent. These rent holidays, allowances and rent escalations are considered in determining the straight-line expense to be recorded over the lease term. Concentrations of Risk and Significant Customers The Company’s financial instruments that are exposed to concentrations of credit risk consist primarily of cash and cash equivalents, short-term investments and accounts receivable. Cash and cash equivalents and short-term investments are currently held in two financial institutions and, at times, may exceed federally insured limits. As of January 31, 2019 and 2018 and for each of the three years ended January 31, 2019 , no single customer represented greater than 10% of accounts receivable or greater than 10% of revenue, respectively. In order to reduce the risk of downtime of the Company’s subscription services, the Company utilizes data center facilities operated by third parties located in Virginia, Oregon, Germany and Ireland. The Company has internal procedures to restore services in the event of disaster at any of its current data center facilities. Even with these procedures for disaster recovery in place, the Company’s subscription services could be significantly interrupted during the time period following a disaster at one of its sites and the subsequent restoration of services at another site. Geographical Information Revenue by location is determined by the billing address of the customer. The following table sets forth revenue by geographic area (in thousands): Year Ended January 31, 2019 2018 2017 United States $ 337,367 $ 217,300 $ 135,364 International 61,887 39,247 25,442 Total $ 399,254 $ 256,547 $ 160,806 Other than the United States, no individual country exceeded 10% of total revenue for the years ended January 31, 2019 , 2018 and 2017 . Property and equipment by geographic location is based on the location of the legal entity that owns the asset. As of January 31, 2019 and 2018 , substantially all of the Company’s property and equipment was located in the United States. Net Loss per Share The Company computes basic and diluted net loss per share attributable to common stockholders in conformity with the two-class method required for participating securities. Under the two-class method, basic net loss per share attributable to common stockholders is calculated by dividing the net loss attributable to common stockholders by the weighted-average number of shares of common stock outstanding during the period, less shares subject to repurchase, without consideration for potentially dilutive securities as they do not share in losses. The diluted net loss per share attributable to common stockholders is computed giving effect to all potential dilutive common stock equivalents outstanding for the period. For purposes of this calculation, options to purchase common stock, unvested RSUs, purchase rights issued under the ESPP, shares subject to repurchase from early exercised options, unvested common stock and restricted stock issued in connection with certain business combinations, convertible senior notes and warrants are considered common stock equivalents but have been excluded from the calculation of diluted net loss per share attributable to common stockholders as the effect is antidilutive. Since the Company's IPO, Class A and Class B common stock are the only outstanding equity of the Company. The rights of the holders of Class A and Class B common stock are identical, except with respect to voting and conversion rights. See Note 14. Recently Adopted Accounting Pronouncements In May 2014, the Financial Accounting Standards Board (FASB) issued ASU No. 2014-09, Revenue from Contracts with Customers (Topic 606). Topic 606 supersedes the revenue recognition requirements in Accounting Standards Codification (ASC) Topic 605, Revenue Recognition (Topic 605), and requires the recognition of revenue when promised goods or services are transferred to customers in an amount that reflects the consideration to which the entity expects to be entitled to in exchange for those goods or services. Topic 606 also includes Subtopic 340-40, Other Assets and Deferred Costs - Contracts with Customers, which requires the deferral of incremental costs of obtaining a contract with a customer. Collectively, the Company refers to Topic 606 and Subtopic 340-40 as "ASC 606." The Company adopted the requirements of ASC 606 as of February 1, 2018, utilizing the full retrospective method of transition. Adoption of ASC 606 resulted in changes to the Company’s accounting policies for revenue recognition and deferred commissions as detailed below. The Company applied ASC 606 using a practical expedient where the consideration allocated to the remaining performance obligations and an explanation of when the Company expects to recognize that amount as revenue for all reporting periods presented before the date of the initial application is not disclosed. The impact of adopting ASC 606 on fiscal 2018 and 2017 revenue is not material. The primary impact of adopting ASC 606 relates to the deferral of incremental costs of obtaining contracts, primarily consisting of sales commissions. Under Topic 605, the Company deferred only direct and incremental commission costs to obtain a contract and amortized those costs on a straight-line basis over the term of the related contract, which was generally one to three years . Under ASC 606, the Company defers all incremental commission costs to obtain the contract. The Company amortizes these costs on a straight-line basis over a period of benefit, determined to be generally five years or the related contractual renewal term. The Company adjusted its consolidated financial statements from amounts previously reported due to the adoption of ASC 606. Select consolidated statement of operations line items, which reflect the adoption of ASC 606, are as follows (in thousands except per share data): Year Ended January 31, 2018 2017 As Reported Adoption of ASU 2014-09 As Adjusted As Reported Adoption of ASU 2014-09 As Adjusted Revenue Subscription $ 239,177 $ (2,755 ) $ 236,422 $ 143,136 $ 1,773 $ 144,909 Professional services and other 20,813 (688 ) 20,125 17,190 (1,293 ) 15,897 Total revenue 259,990 (3,443 ) 256,547 160,326 480 160,806 Sales and marketing 172,973 (7,953 ) 165,020 118,742 (7,973 ) 110,769 Total operating expenses 295,597 (7,953 ) 287,644 187,500 (7,973 ) 179,527 Net loss (114,359 ) 4,510 (109,849 ) (83,509 ) 8,453 (75,056 ) Net loss per share, basic and diluted $ (1.38 ) $ 0.06 $ (1.32 ) $ (4.39 ) $ 0.45 $ (3.94 ) Select consolidated balance sheet line items, which reflect the adoption of ASC 606, are as follows (in thousands): As of January 31, 2018 As Reported Adoption of ASU 2014-09 As Adjusted Assets Current assets: Deferred commissions $ 16,481 $ 1,274 $ 17,755 Prepaid expenses and other current assets 16,973 808 17,781 Total current assets 315,416 2,082 317,498 Deferred commissions, noncurrent 10,971 29,784 40,755 Total assets $ 367,397 $ 31,866 $ 399,263 Liabilities and stockholders’ equity Deferred revenue $ 162,633 $ (2,817 ) $ 159,816 Total current liabilities 190,760 (2,817 ) 187,943 Deferred revenue, noncurrent 6,034 (1,071 ) 4,963 Total liabilities 203,811 (3,888 ) 199,923 Accumulated deficit (402,468 ) 35,754 (366,714 ) Total stockholders’ equity $ 163,586 $ 35,754 $ 199,340 The adoption of ASC 606 had no impact on cash provided by or used in operating, investing, or financing activities in the Company’s consolidated statement of cash flows. Additionally, the adoption of ASC 606 did not have a material impact on the provision for (benefit from) income taxes. The adoption adjustments impacted the deferred income taxes pertaining to the U.S. entity which are subject to a full valuation allowance. In February 2018, the FASB issued ASU No. 2018-02, Reclassification of Certain Tax Effects from Accumulated Other Comprehensive Income (ASU 2018-02). Under existing U.S. GAAP, the effects of changes in tax rates and laws on deferred tax balances are recorded as a component of income tax expense in the period in which the law was enacted. When deferred tax balances related to items originally recorded in accumulated other comprehensive income (loss) are adjusted, certain tax effects become stranded in accumulated other comprehensive income. The amendments in ASU 2018-02 allow a reclassification from accumulated other comprehensive income (loss) to retained earnings (accumulated deficit) for stranded income tax effects resulting from the 2017 Tax Cuts and Jobs Act. The amendments in this ASU also require certain disclosures about stranded income tax effects. The guidance is effective for fiscal years beginning after December 15, 2018, and interim periods within those fiscal years. Early adoption in any period is permitted. The Company’s provisional adjustments recorded in fiscal 2018 to account for the impact of the 2017 Tax Cuts and Jobs Act did not result in stranded tax effects. The early adoption of this standard did not have a material impact on the Company’s consolidated financial statements. In June 2018, the FASB issued ASU No. 2018-07, Compensation - Stock Compensation (Topic 718) Improvements to Non-Employee Share Based Payment Accounting (ASU 2018-07), with an intent to reduce cost and complexity and to improve financial reporting for share-based payments issued to non-employees. The amendments in ASU 2018-07 provide for the simplification of the measurement of share-based payment transactions for acquiring goods and services from non-employees. This standard expands the scope of Topic 718 to include share-based payments issued to non-employees for goods or services, aligning the accounting for share-based payments to non-employees and employees. This guidance is effective for annual and interim periods beginning after December 15, 2018, and early adoption is permitted. The early adoption of this standard did not have a material impact on the Company’s consolidated financial statements. In August 2018, the FASB issued ASU No. 2018-13, Disclosure Framework - Changes to the Disclosure Requirements for Fair Value Measurement (ASU 2018-13), which amends ASC 820, Fair Value Measurement. ASU 2018-13 modifies the disclosure requirements for fair value measurements by removing, modifying or adding certain disclosures. This guidance is effective for the Company on February 1, 2020, with early adoption permitted for the removal and modification of disclosures and delayed adoption until February 1, 2020 permitted for the new disclosures. The removed and modified disclosures have been adopted on a retrospective basis, and the new disclosures have been adopted on a prospective basis. The early adoption of this standard did not have a material impact on the Company’s consolidated financial statements. Recent Accounting Pronouncements Not Yet Adopted In February 2016, the FASB issued ASU No. 2016-02 (Topic 842), Leases (ASU 2016-02), which supersedes the guidance in topic ASC 840, Leases. The new standard requires lessees to apply a dual approach, classifying leases as either finance or operating leases based on the principle of whether or not the lease is effectively a financed purchase by the lessee. This classification will determine whether lease expense is recognized based on an effective interest method or on a straight-line basis over the term of the lease. A lessee is also required to record a right-of-use asset (ROU) and a lease liability for all leases with a term of greater than 12 months regardless of their classification. Leases with a term of 12 months or less will be accounted for similar to existing guidance for operating leases today. Under the standard, disclosures are required to meet the objective of enabling users of financial statements to assess the amount, timing, and uncertainty of cash flows arising from leases. The Company will be required to recognize and measure leases existing at, or entered into after, the beginning of the earliest comparative period presented using a modified retrospective approach, with certain practical expedients available. ASU 2016-02 is effective for the Company beginning February 1, 2019. The Company expects to elect the available practical expedients on adoption. The Company is assessing the impact of ASU 2016-02 on its internal controls over financial reporting. Adoption of ASU 2016-02 will have a material impact on the Company's consolidated balance sheets, but will not have a material impact on the Company's consolidated income statements and taxes. The most significant impact will be the recognition of ROU assets and lease liabilities for operating leases. The Company expects adoption of the standard will result in the recognition of additional ROU assets and lease liabilities for operating leases in the range of approximately $121 million to $126 million , and $158 million to $163 million , respectively, as of January 31, 2019 . Additionally, the adoption of this standard will have no impact to cash provided by or used in operating, financing, or investing activities on the Company's consolidated cash flows statements. In August 2018, the FASB issued ASU 2018-15, Customer’s Accounting for Implementation Costs Incurred in a Cloud Computing Arrangement That Is a Service Contract (ASU 2018-15), which requires a customer in a cloud computing arrangement that is a service contract to follow the internal-use software guidance in Account |