How to count ad impressions
Since it sounds like you're rolling-your-own, and can afford a relatively simple implementation, I'd recommend checking out the seq(…) Twig function that Craft provides.

{% do seq("ad-impressions-#{ad.uid}") %}


Then, if you have a dashboard of some kind for advertisers/partners, you could display those tallies by iterating over their “owned” advertisements:

{% for ad in ads %}
    {{ ad.title }} views: {{ seq("ad-impressions-#{ad.uid}", null, false) }}
{% endfor %}


Here, the third argument tells the function to read the value, but not increment it.


  Of course, this is extremely crude. It assumes you only need to count the number of times an ad is rendered into a page, and makes no guarantees about how many times it’s actually seen. It also won't increment if the page is cached.


Overall, I'd recommend outputting the ad with some kind of identifying information, and firing a custom Google Analytics event… or—time permitting—write a custom controller to ping via AJAX when an ad is actually displayed in a browser. Keep in mind that somewhere in here, you're apt to be able to deliver a better product with an existing plugin!