It’s simple. You use a URL with the campaign id, and store that when the customer clicks through, then when a sale is made you count that towards the campaign. In offline advertising people would achieve this using campaign-specific phone numbers or discount code given in the ad.
Online advertising math is not rocket science. If ROAS is positive you continue the campaign, if not you abandon it or try other methods.
Guess we'll skip branding and awareness campaigns, ignore all post-view purchases, not use cross-device or cross-channel attribution, and not look at attribution of offline conversion/visitation activity.
If the only thing you do is Search and Email Blasts, the query string on your URL might work okay.
The query string method will not provide stats for the above point; but the newer methods e.g. using the FB pixel that tracks users based on the user's email/userid you create can accomplish much of that (only offline conversions are difficult, but there are still modern ways to match an offline customer with their past ad exposure e.g. if you get their email/phone on purchase...)
Direct conversion to sale via clickthroughs are an almost invisibly small part of online ads . No advertiser uses only that metric for determining ROAS.
I can’t speak for ad agencies, but every company I’ve worked with to do advertising measured ROAS using customer attribution (which ad campaign brought which customer, and how much did that customer spend).
Online advertising math is not rocket science. If ROAS is positive you continue the campaign, if not you abandon it or try other methods.