coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Rowdy on December 30, 2013, 09:05:27 PM

Title: Inject an ad spot in place of image every X images
Post by: Rowdy on December 30, 2013, 09:05:27 PM
I am using picture navigation with intermediate images as the main way to browse a photo gallery. What I would like to figure out is how to inject an ad spot IN PLACE of an intermediate image, every X images and/or perhaps at the end of the gallery. So if I chose every 5th image, you would see photos 1 - 4, then the next would take you to an ad display, then the next would take you to image 5 and so on. I would not use this for Adsense, but for other networks or banners or local promotions.

I also welcome suggestions for the gallery and the site.
http://lesharorv.com/gallery/displayimage.php?album=10&pid=28#top_display_media

Title: Re: Inject an ad spot in place of image every X images
Post by: Rowdy on January 03, 2014, 03:41:51 AM
I have found some success. I found access to the PID variable by assigning it in theme.php before the EOT:

$pid = $superCage->get->getInt('pid');  read more (http://forum.coppermine-gallery.net/index.php/topic,76545.msg369347.html#msg369347)

and then referencing it from the template within javascript that toggles display from none to block and then running the ad code below.

if ({$pid} % 5 === 0) {
var mydiv = document.getElementById('adbox');
    mydiv.style.display = 'block'
  }

If the above is true, and javascript is enabled, the ad spot will display every 5 photos. If javascript is disabled, the DIV stays display:none;
This ad spot is much better than something to the side of the photo. And I am not going to use Adsense here as there is rarely context for the bots. I can do some additional magic and cycle through other ad networks and even my own ad spots. I have found a lot of success on my niche sites by displaying related ebay and amazon products. So I typically random cycle through keyword lists of search terms.

Definitely interested in peoples thoughts on this. I am surprised there is no plugin yet to do this sort of thing, perhaps without javascript.

http://lesharorv.com/gallery/displayimage.php?album=10&pid=25#top_display_media

Title: Re: Inject an ad spot in place of image every X images
Post by: gmc on January 03, 2014, 05:20:45 AM
I followed your link, and scrolled thru the 35 pictures.
I received a pop-up ad over photos 1,5,9,11,20,24,25 - then nothing thru 35.

Personally I would have left the site by photo 11 - after having to close 4 windows that took much longer to load than normal pages, and 3 of the 4 ads (and more on later pages) trying to sell me the same 2 products I already bought from that vendor in the last two weeks.

But I dislike pop up ads...  :D - see what others say.
Title: Re: Inject an ad spot in place of image every X images
Post by: Rowdy on January 03, 2014, 05:42:44 AM
I think of it as an experiment for now. Nobody likes popups of course. I can tweak the numbers higher and could also look at different formats such as a leaderboard across the bottom perhaps. I am wondering if there is any good way to monetize a photo gallery really. I suspect those using adsense on every photo arent adding positively to their adsense stats.