Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Adding Adsense tags to photo captions to increase relevance  (Read 3568 times)

0 Members and 1 Guest are viewing this topic.

lesault

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
    • www.ThePoltergeist.com
Adding Adsense tags to photo captions to increase relevance
« on: October 03, 2006, 09:40:25 pm »

I've been hunting around the forums for information on adding Adsense code to my Coppermine 1.4.9 site. I think I've worked it out myself.

Adding the actual code:
  On the main page, I used xplicit's excellent advise: http://forum.coppermine-gallery.net/index.php?topic=29265.0
  On the thumbnail pages, I added the code using Mini-CMS (click the 'source' button and paste the adsense code in)

Relevance:
  The ads which are being served are all for Photo Printing, gallery hosting etc which is not what my site is about. The Adsense help pages at Google suggest adding
Code: [Select]
<!-- google_ad_section_start --> and
Code: [Select]
<!-- google_ad_section_end --> tags around relevant content to increase the weighting of that content. Apparently it takes a few days for the change to take effect though.
  In order to add these tags around every caption, open include/functions.inc.php and make the following change.

Search for
Code: [Select]
        if ($CONFIG['caption_in_thumbview']){
            $caption .= $row['caption'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['caption']))."</span>" : '';

Replace with
Code: [Select]
        if ($CONFIG['caption_in_thumbview']){
            $caption .= $row['caption'] ? "<span class=\"thumb_caption\"><!-- google_ad_section_start -->".strip_tags(bb_decode($row['caption']))."<!-- google_ad_section_end --></span>" : '';

Everywhere your caption appears it will now have the Adsense tags around it.

I hope this saves someone some time - I'll let you know when if the relevant ads start showing up!

You can see it in action at http://www.thepoltergeist.com
Logged
www.thepoltergeist.com - Are YOU brave enough?

lesault

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
    • www.ThePoltergeist.com
Re: Adding Adsense tags to photo captions to increase relevance
« Reply #1 on: October 06, 2006, 02:13:04 pm »

It's taken 2 and a half days to make any difference, but I'm now not getting (so many) ads for photo printing services and gallery hosts. The ads look much better targeted to the sort of interests visitors to my site would have. Just need to get rid of the splash page and I'll be pretty happy with my site!
Logged
www.thepoltergeist.com - Are YOU brave enough?

jimboo

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Adding Adsense tags to photo captions to increase relevance
« Reply #2 on: October 16, 2006, 08:36:06 pm »

Thank you very much! I'm going to try it right now..
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 21 queries.