views:

28

answers:

1

*FYI: I'm not using Adsense and this is not against my TOS...

I have pages that display jquery slideshows. I used to create the slideshows in html and so every slide change would be a pageview. Now that I'm using javascript for the slideshow I am only registering one ad impression for every slide viewed. I'd like to find a way to have my ads refreshed every time the reader clicks to view the next slide. Any suggestions on how to accomplish this?

A: 

This really depends on how you load your ad off of the ad network. But, you could put the ad code in a separate file and then do something like this each time the slide changes: $("#adspace").load('adfile.html');

This would be a nice, generic, way of updating the ad each time the slide changes.

Calle
Thanks for the quick reply. My DFP ad tags are inserted into php files now and called into my template dynamically as needed so this sounds like it'll work well. One of the the slideshow solutions I was planning on implementing is slidedeck. Do you think I could integrate with with their callback function: http://www.slidedeck.com/usage-documentation/usage_actions/ ?
matt
yes, it would definitely be possible. Just put the load code in the callback function and it will work.
Calle
Thanks for the answer. I haven't marked it as solved yet because I still haven't figured it out how to make it work.
matt
// Pass an object with before and complete callback actionsslidedecks[0].goTo(2,{ before: function(deck){ alert(deck.current); // Alert the current slide number before animating }, complete: function(deck){ $("#adspace").load('adfile.html'); }});Something like the above... it's just my previous code and the example code put together. Please elaborate on what doesn't work if you want more help.
Calle