Here are my 2 cents if you have analytics on our website:
Use the following code to display the link:
<a class="ad" href="http://thecatisginger.com/" target="_blank" onclick="ga('send', 'event', 'Block-3-Ads', 'Click', 'The-Cat-Is-Ginger-Ad');"><img src="http://citybymouth.com/wp-content/uploads/2015/02/TCIG-Advert.jpg" onload="ga('send', 'event', 'Block-3-Ads', 'Impression', 'The-Cat-Is-Ginger-Ad', {'nonInteraction': 1});" /></a>
Explain:
<a class="ad" href="http://thecatisginger.com/" target="_blank"
The classic href link with the class declaration, links to the site, the target opens in a new tab. Easy.
onclick="ga('send', 'event', 'Block-3-Ads', 'Click', 'The-Cat-Is-Ginger-Ad');">
This is the latest Google Analytics.js event tracking, the onclick event code, which basically says hey you clicked this link, so "send" this "event" to my analytic "Events" (which can be checked in the "Events" section in real time "or" Behavior> Events "). "Block-3-Ads" is the area on my website that I personally know as the area in which I place ads, in particular its right side area, but that may be all you want, so make your type a broad category in which you will have different links that you want to track. "Click" is just the type of event you want to track, it can be anything. "The-Cat-Is-Ginger-Ad" is a special ad that I want to track and have information about it.
<img src="http://citybymouth.com/wp-content/uploads/2015/02/TCIG-Advert.jpg"
Then you have img with src. Easy.
onload="ga('send', 'event', 'Block-3-Ads', 'Impression', 'The-Cat-Is-Ginger-Ad', {'nonInteraction': 1});" />
Then you have the onload event, which fires when the image is loaded, it says: “send” this “event”, classify it as the “Block-3-Ads” event, basically loading the image is considered as 'Impression' before it clicks but not since this little "onload" is called upon loading, it’s not a click, but loading / displaying, and again, in particular, the loaded ad - "The-Cat-Is-Ginger" -A ', and, finally, the parameter 'nonInteraction' is passed as 1, which simply tells Google that you are tracking the interaction event.
His pretty explanator, maybe I scored too much.
WARNING. This is not ideal for loading a page, and the ad may be below the viewing area, out of the user's field of view, and it still seems that it’s inaccurate, so in the next I’ll work on the first run of the impression code, when the user actually scrolls to the ad itself and looks at it, but does not start it every time the page loads this image.