Measure ad conversions

How to measure when an ad click or view leads to a purchase or other events