Hi,
I have a website where we use the Google Ad Manager to serve ads on the site. I would like to create a "Report this Ad" link that sends someone email about the problem, but it also needs to tell them the exact ad that was displayed at that moment.
There is just a small snippet of code that Google replaces with the ad code, example below.
<script type="text/javascript" language="javascript">
GA_googleFillSlot("replaced_description_300x514_3");
</script>
On the Google site we have an ad network setup which does the same thing, replacing it's code with an actual ad. A generic example of what that code might look like is below.
<!-- begin ad tag -->
<script language="JavaScript" type="text/javascript">
ord=Math.random()*10000000000000000;
document.write('<scr' + 'ipt language="JavaScript" src="http://ad.doubleclick.net/adj/removed-tag/removed-location-data;dma=removed-num;org=removed-org-type;state=removed-state;own=removed-owner;sz=728x90;ord=' + ord + '?" type="text/javascript"></scr' + 'ipt>');
</script><noscript><a href="http://ad.doubleclick.net/jump/removed-tag/removed-location-data;dma=removed-num;org=removed-org-type;state=removed-state;own=removed-owner;sz=728x90;ord=123456789?" target="_blank"><img src="http://ad.doubleclick.net/ad/removed-tag/removed-location-data;dma=removed-number;org=removed-org-type;state=removed-state;own=removed-owner;sz=728x90;ord=123456789?" width="728" height="90" border="0" alt=""></a></noscript>
<!-- End ad tag -->
We have several different networks that serve ads in a similar but different fashion.
Is there a bit of JavaScript magic that I could use to figure out the RESULT of those sets of JavaScript code? In other words, the image or flash file that was ultimately displayed? Can I read a list of all images in the DOM at some point using JavaScript?
I'm not sure where to start to figure out what ad is displaying. Of course, viewing source just shows the original Google code.
Any suggestions for where to start to figure out what ad is displayed?