To address your inquiries:
Firstly, if the advertisement utilizes iframes from a separate domain than the page, you will face more limitations in terms of what actions you can take. In that scenario, your only option would be to overlay the ad with a transparent object placed within your own page. However, by doing so, the ad will no longer register any clicks.
If the ad does not utilize iframes from a different domain, then you have the following options for your two questions:
1) You can generate a transparent div using JavaScript and insert it into the same parent element as the ad. By utilizing CSS positioning, you can position this div on top of the ad if that is your intention. The specific details of this positioning will depend on how the ad itself is positioned. Alternatively, if the ad is just a single div, you could embed a transparent div inside the ad and size it to cover the entire area of the ad. In this case, the transparent object would initially receive the click, but the click event would eventually propagate up to the parent element which is the ad itself.
2) Clicking on a transparent object positioned above the ad will cause the click to initially register on the transparent object rather than the ad. This is because the click is detected by the top-most object that was clicked on, although the click event can bubble up to parent elements. Therefore, if the ad is also considered a parent element, the click will eventually reach the ad as well.
If your main concern is tracking clicks, you might find it more practical to simply add your own eventListener for clicks on the existing ad without inserting an additional layer above it. This approach would involve waiting until the ad is loaded, identifying the correct object, and then attaching your eventListener (assuming the ad is not inserted via iframes from a different domain).