Companies tag this figure in XBRL as CostOfGoodsAndServicesSold. That element replaced the separate goods-only and services-only elements, which the taxonomy has since deprecated. Regulation S-X Rule 5-03.2 asks companies to show the cost of tangible goods sold and the cost of services as separate amounts. It also lets wholesalers and retailers include occupancy and buying costs with their cost of goods sold.
For products, the figure comes out of inventory. Under ASC 330, manufacturing costs are first capitalized as inventory and move to the income statement only when the goods are sold, so the method a company uses to assign costs (FIFO, LIFO, or weighted average) directly affects this line. In a period of rising input prices, LIFO charges the newest, most expensive costs first and produces a higher cost of goods sold than FIFO. Inventory write-downs to net realizable value usually land here too.
Companies also differ on depreciation. Some include depreciation of production equipment in cost of goods sold, while others show it separately and tag the line CostOfGoodsAndServiceExcludingDepreciationDepletionAndAmortization. Revenue minus this cost gives gross profit, so any difference in what sits inside it carries straight through to gross margin comparisons.