Hi,
Hope you are well.
Yes, you can implement ads by using shortcodes in the related link template. Like the below code snippet in your PHP file,
<?php echo do_shortcode('[your-shotcode]'); ?>
Let me know if you need further assistance regarding this matter.
Regards