CPL is calculated by dividing the total cost of a campaign by the number of leads it generated. For example, if a company spent $500 on a campaign and generated 50 leads, the CPL would be $10 (500/50 = 10).