I'm trying to convert the following code into a "onClick" event to add to a HREF tag. I have limited JavaScript experience, but I know it can be done. Any sort of guidance would be greatly appreciated.
<script type="text/javascript">
var axel = Math.random() + "";
var a = axel * 10000000000000;
document.write('<iframe src="https://4607507.fls.doubleclick.net/activityi;src=4607507;type=ustac0;cat=lwt16db;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
</script>
<noscript>
<iframe src="https://4607507.fls.doubleclick.net/activityi;src=4607507;type=ustac0;cat=lwt16db;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</noscript>
The Floodlight documentation explains how to accomplish something like this:
This should mostly get you there, but will also need to customize
flDiv.innerHTML
and theonclick()
function with the appropriate Floodlight string values for your project.