v3.22.4

Stockholders’ Equity and Equity Incentive Plans - Weighted-Average Assumptions (Details) - $ / shares | 12 Months Ended
--- | ---
Dec. 31, 2022 | Dec. 31, 2021 | Dec. 31, 2020
Share-based Payment Arrangement, Expensed and Capitalized, Amount [Line Items] |  |  |
Dividend rate | 0.00% | 0.00% | 0.00%
Weighted-average grant date fair value of options granted (in usd per share) | $ 13.70 | $ 20.30 | $ 4.96
ESPP |  |  |
Share-based Payment Arrangement, Expensed and Capitalized, Amount [Line Items] |  |  |
Risk-free interest rate |  | 0.10% |
Dividend rate | 0.00% | 0.00% |
Minimum |  |  |
Share-based Payment Arrangement, Expensed and Capitalized, Amount [Line Items] |  |  |
Fair market value of common stock (in usd per share) | $ 18.63 | $ 39.75 | $ 3.20
Expected term (in years) | 5 years | 5 years 9 months 18 days | 5 years 8 months 12 days
Risk-free interest rate | 1.80% | 0.60% | 0.30%
Expected volatility | 54.00% | 51.00% | 50.00%
Minimum | ESPP |  |  |
Share-based Payment Arrangement, Expensed and Capitalized, Amount [Line Items] |  |  |
Expected term (in years) | 6 months | 4 months 24 days |
Risk-free interest rate | 1.60% |  |
Expected volatility | 83.00% | 60.00% |
Maximum |  |  |
Share-based Payment Arrangement, Expensed and Capitalized, Amount [Line Items] |  |  |
Fair market value of common stock (in usd per share) | $ 31.79 | $ 54.07 | $ 17.00
Expected term (in years) | 7 years | 6 years 8 months 12 days | 6 years 4 months 24 days
Risk-free interest rate | 3.40% | 1.00% | 1.50%
Expected volatility | 57.00% | 54.00% | 55.00%
Maximum | ESPP |  |  |
Share-based Payment Arrangement, Expensed and Capitalized, Amount [Line Items] |  |  |
Expected term (in years) | 1 year | 1 year 4 months 24 days |
Risk-free interest rate | 2.20% |  |
Expected volatility | 79.00% | 76.00% |

X
- Definition Line items represent financial concepts included in a table. These concepts are used to disclose reportable information associated with domain members defined in one or many axes to the table. + References No definition available. + Details
Name: | us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems
Namespace Prefix: | us-gaap_
Data Type: | xbrli:stringItemType
Balance Type: | na
Period Type: | duration

X
- Definition Agreed-upon price for the exchange of the underlying asset relating to the share-based payment award. + References No definition available. + Details
Name: | us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExercisePrice
Namespace Prefix: | us-gaap_
Data Type: | dtr-types:perShareItemType
Balance Type: | na
Period Type: | instant

X
- Definition The estimated dividend rate (a percentage of the share price) to be paid (expected dividends) to holders of the underlying shares over the option's term. + References Reference 1: http://www.xbrl.org/2003/role/disclosureRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (f)(2)(iii) -URI https://asc.fasb.org/extlink&oid=128089324&loc=d3e5070-113901 + Details
Name: | us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate
Namespace Prefix: | us-gaap_
Data Type: | dtr-types:percentItemType
Balance Type: | na
Period Type: | duration

X
- Definition The estimated measure of the percentage by which a share price is expected to fluctuate during a period. Volatility also may be defined as a probability-weighted measure of the dispersion of returns about the mean. The volatility of a share price is the standard deviation of the continuously compounded rates of return on the share over a specified period. That is the same as the standard deviation of the differences in the natural logarithms of the stock prices plus dividends, if any, over the period. + References Reference 1: http://www.xbrl.org/2003/role/disclosureRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (f)(2)(ii) -URI https://asc.fasb.org/extlink&oid=128089324&loc=d3e5070-113901 + Details
Name: | us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate
Namespace Prefix: | us-gaap_
Data Type: | dtr-types:percentItemType
Balance Type: | na
Period Type: | duration

X
- Definition The risk-free interest rate assumption that is used in valuing an option on its own shares. + References Reference 1: http://www.xbrl.org/2003/role/disclosureRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (f)(2)(iv) -URI https://asc.fasb.org/extlink&oid=128089324&loc=d3e5070-113901 + Details
Name: | us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate
Namespace Prefix: | us-gaap_
Data Type: | dtr-types:percentItemType
Balance Type: | na
Period Type: | duration

X
- Definition The weighted average grant-date fair value of options granted during the reporting period as calculated by applying the disclosed option pricing methodology. + References Reference 1: http://www.xbrl.org/2003/role/disclosureRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (d)(1) -URI https://asc.fasb.org/extlink&oid=128089324&loc=d3e5070-113901 + Details
Name: | us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue
Namespace Prefix: | us-gaap_
Data Type: | dtr-types:perShareItemType
Balance Type: | na
Period Type: | duration

X
- Definition Expected term of award under share-based payment arrangement, in 'PnYnMnDTnHnMnS' format, for example, 'P1Y5M13D' represents reported fact of one year, five months, and thirteen days. + References Reference 1: http://www.xbrl.org/2003/role/disclosureRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (f)(2)(i) -URI https://asc.fasb.org/extlink&oid=128089324&loc=d3e5070-113901 + Details
Name: | us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1
Namespace Prefix: | us-gaap_
Data Type: | xbrli:durationItemType
Balance Type: | na
Period Type: | duration

X
- Details
Name: | us-gaap_AwardTypeAxis=pubm_ESPPMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |

X
- Details
Name: | srt_RangeAxis=srt_MinimumMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |

X
- Details
Name: | srt_RangeAxis=srt_MaximumMember
Namespace Prefix: |
Data Type: | na
Balance Type: |
Period Type: |