See this: http://infiniteajaxscroll.com/docs/events.html#rendered
So, place all the ad code in an ajax function (http://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_%28action%29)
add_action( 'wp_ajax_your_ad_fn', 'your_ad_fn');
add_action( 'wp_ajax_nopriv_your_ad_fn', 'your_ad_fn');
function your_ad_fn(){
// your ad code here
// if sending js, set Content-type header to application/javascript
// if sending html, text/html
}
Then in your custom js,
ias.on('rendered', function(items) {
var $items = $(items);
jQuery.get(
'http://yoursite.com/wp-admin/admin-ajax.php', // I've just illustrated, don't write the url directly, do it via wp_localize_script
).done( function( data ) ){
$items.after(data); // append ad after all the loaded posts
});
})
This is NOT the exact code, you have to work out some details, yourself.