View Full Version : How do I target ads to specific forums?
ski diva
06-08-2007, 01:28 PM
I know how to get an ad to appear at the top of the page of each forum. Right now I have the same ad appearing for each one. But I'd like to make it so that the ads are forum specific. For example, if I have a forum on "Decorating," I'd like to have an ad that's relevant to that. Or if I have a forum on "Gardening," there'd likewise be an appropriate ad.
Can anyone help?
Dismounted
06-09-2007, 03:56 AM
Are you using any ad provider?
ski diva
06-09-2007, 09:52 AM
Yes, I'm using OpenAds.
Dismounted
06-09-2007, 10:54 AM
It should automatically display relevant ads. Or am I wrong?
ski diva
06-09-2007, 11:00 AM
I'm trying to target specific ads to show in specific forums. For example, I'd like to have ads about "gardening" appear in the "gardening" forum, or ads about "decorating" in the decorating forum. So it wouldn't be the same ad appearing in all the forums.
I'm not sure how to do that (I'm new at Openads), so if you can tell me how, it'd be very much appreciated.
Dismounted
06-09-2007, 11:07 AM
If it's like AdSense, it would automatically pick up keywords from the page.
ski diva
06-09-2007, 11:14 AM
I don't think it does that. Openads works by establishing zones and then linking ads by keywords to each zone. I can set up a zone for "forums" in general," but I can't figure out how to do this for each specific forum.
Dismounted
06-09-2007, 11:29 AM
In the ad code, does it have a place to put the "zone"?
ski diva
06-09-2007, 08:34 PM
Yes.
Here's an example of the code:
<script language='JavaScript' type='text/javascript' src='http://www.XXXXXX.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&what=zone:3");
document.write ("&exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXX.com/openads/adclick.php?n=a6bd937f' target='_blank'><img src='http://www.XXXXX.com/openads/adview.php?what=zone:3&n=a6bd937f' border='0' alt=''></a></noscript>
tobybird
06-09-2007, 11:12 PM
Have you looked through the Openads forum? I just found this... Is this what you are wanting to accomplish?
Howto: Using Keywords For Banner Selection Discussion (http://forum.openads.org/index.php?showtopic=503412731)
What about the following:
I want to show the selected banners on the pages, on which there is a specific text.
Example: The word "Marketing" is mentioned on the page
I want those banners shown, which have "Marketing" in keyword.
Is this possible?
No, this is contextual advertising, that's not supported by OpenAds. It is a very difficult process to filter out key words and use those to drive the ads. Google are good at that, they call it Adsense.
Dismounted
06-10-2007, 02:48 AM
Yes.
Here's an example of the code:
Replace the two instances of "zone:3" with:
zone:<if condition="$foruminfo['forumid'] == FORUMID">ZONENUMBER<else />3</if>
To do this with multiple forums:
zone:<if condition="$foruminfo['forumid'] == FORUMID">ZONENUMBER<else /><if condition="$foruminfo['forumid'] == FORUMID2">ZONENUMBER2<else />3</if></if>
ski diva
06-11-2007, 11:54 PM
Thanks, Dismounted, but this doesn't seem to work; all it seems to do is remove the ad from all the forums instead of allowing me to deliver a specific ad to a specific forum.
I must be doing something wrong, but I don't know what it is.
And tobybird: I'm not trying to do contextual advertising. It's more straightforward than that; what I want to do is have the ads vary by forum. For example, if there's a "gardening" forum, I want to have a specific gardening ad there. If there's a "cooking" forum, the ad would be different. Or maybe have I'd have all the forums with the same ad, except for one.
HELP!!!!!
Dismounted
06-12-2007, 09:27 AM
You need to create multiple zones and replace the capitalised words in the code I gave you.
ski diva
06-12-2007, 05:39 PM
Let me try to restate my problem, so that I can take advantage of the help you're trying to give me!
All of my forums draw from the same template. There are a dozen different forums, to each of which I would like to deliver a specific banner. The Cooking forum gets a Cooking ad. The Ratkilling forum gets a Ratkilling ad. And so on.
Right now, I can only deliver the same ad (or range of ads) to all forums. Which is fine if I have an advertiser who sells both Cooking and Ratkilling equipment.
How can I specify which goes where?
Dismounted
06-13-2007, 09:36 AM
You need to setup multiple zones to match the forums and use the code I gave you to assign a different zone to each forum.
ski diva
06-13-2007, 02:19 PM
Sorry to be so dense about this (you're being so helpful), but I must be doing something wrong. I established another zone and put the invocation code for it in the forumdisplay template, below the code for the first zone. Then I changed the invocation code in the first zone, as you suggested, and all that happens is I get the same ad going to all forums (the one I wanted to target to a specific forums). Maybe you could take a look and let me know what I'm doing wrong? I'd appreciate the help:
<script language='JavaScript' type='text/javascript' src='http://www.XXXXXXX.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&what=zone: <if condition=”$foruminfo [ ‘forumid’ ] == id:11”>zone:7<else />3</if>");
document.write ("&exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXXXX.com/openads/adclick.php?n=a6409d73' target='_blank'><img src='http://www.XXXXXXX.com/openads/adview.php?what=zone: <if condition=”$foruminfo [ ‘forumid’ ] == id:11”>zone:7<else />3</if></if>&n=a6409d73' border='0' alt=''></a></noscript>
<script language='JavaScript' type='text/javascript' src='http://www.theskidiva.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&what=zone:7");
document.write ("&exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXXXX.com/openads/adclick.php?n=a9afbf66' target='_blank'><img src='http://www.XXXXXXX.com/openads/adview.php?what=zone:7&n=a9afbf66' border='0' alt=''></a></noscript>
Edited a little bit later:
I changed the code to the following:
zone:<if condition="$foruminfo['forumid'] == 11">7<else />3</if>
and now I'm getting both ads (side by side) in all forums. I only want the ad that's linked to zone 7 in one of the forums (in this case, id:11). The rest of the forums get the ad that's linked to zone 3
Any ideas?
Dismounted
06-14-2007, 06:59 AM
<script language='JavaScript' type='text/javascript' src='http://www.XXXXXXX.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&what=zone:<if condition="$foruminfo['forumid'] == 11">7<else />3</if>");
document.write ("&exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXXXX.com/openads/adclick.php?n=a6409d73' target='_blank'><img src='http://www.XXXXXXX.com/openads/adview.php?what=zone:<if condition="$foruminfo['forumid'] == 11">7<else />3</if>&n=a6409d73' border='0' alt=''></a></noscript>
<script language='JavaScript' type='text/javascript' src='http://www.theskidiva.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&what=zone:<if condition="$foruminfo['forumid'] == 11">7<else />3</if>");
document.write ("&exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXXXX.com/openads/adclick.php?n=a9afbf66' target='_blank'><img src='http://www.XXXXXXX.com/openads/adview.php?what=zone:7&n=a9afbf66' border='0' alt=''></a></noscript>
ski diva
06-14-2007, 12:19 PM
Sorry to say this didn't work, either.
Any other ideas? I really need some help!
Dismounted
06-15-2007, 09:43 AM
What happens?
ski diva
06-15-2007, 11:45 AM
I get both ads side by side in all the forums, rather than one ad in all forums exccept one where it'd be replaced by the other ad.
Dismounted
06-16-2007, 04:30 AM
You only need one set of them, not two. So just use this:
<script language='JavaScript' type='text/javascript' src='http://www.XXXXXXX.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&what=zone:<if condition="$foruminfo['forumid'] == 11">7<else />3</if>");
document.write ("&exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXXXX.com/openads/adclick.php?n=a6409d73' target='_blank'><img src='http://www.XXXXXXX.com/openads/adview.php?what=zone:<if condition="$foruminfo['forumid'] == 11">7<else />3</if>&n=a6409d73' border='0' alt=''></a></noscript>
ski diva
06-19-2007, 04:21 PM
Thanks for all your help, but this is not working at all.
So I thought I'd just try to keep the ads from feeding in to one specific forum entirely, but I haven't had any luck with that, either. Any suggestions?
Dismounted
06-20-2007, 07:02 AM
<script language='JavaScript' type='text/javascript' src='http://www.XXXXXXX.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&what=zone:<if condition="$forum['forumid'] == 11">7<else />3</if>");
document.write ("&exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXXXX.com/openads/adclick.php?n=a6409d73' target='_blank'><img src='http://www.XXXXXXX.com/openads/adview.php?what=zone:<if condition="$forum['forumid'] == 11">7<else />3</if>&n=a6409d73' border='0' alt=''></a></noscript>
Try that. It is still the zone changing thing.
ski diva
06-20-2007, 04:59 PM
I know it sounds nuts, and I really appreciate your help, but this doesn't work, either.
Boy, this is frustrating!!!!!!
Dismounted
06-21-2007, 05:45 AM
What happens? Have you replaced the XXXXXXX.com's?
TheMilkCarton
06-21-2007, 07:32 AM
Are you using "forums" as a general word, ski diva?
If you're trying to get this to show up in individual threads shouldn't "$thread[forumid]" be used then?
Also, I've never even used "$foruminfo['forumid']" either.. I've only used "$forumid" or "$forum[forumid]".. I'm not saying "$foruminfo[forumid]" is wrong, but is there any actual benefit in using it over the shorthand, Dismounted?
I also don't understand why single quotations are required in the code? (e.g. $foruminfo['forumid']). Also, speaking of the single quotations, I've noticed in the code ski diva has posted there are extra spaces in the conditional code ($foruminfo[SPACE'forumid'SPACE]). Not sure if this matters.
Well, anyway.. I was just trying to offer up some possible reasons why the code isn't working. Also, if you were getting double ads on each page, I'd say you were copying the code twice? I don't think even vBulletin misunderstanding the conditional code could cause double ads in this situation.
Although.. Dismounted is wayyyyyyyy smarter than me, so probably everything I've suggested is wrong. :)
Anyway.. You haven't been very descriptive about where you're trying to use this code, so maybe just try $forumid == 11 or $thread[forumid] ==11 instead.
Dismounted
06-21-2007, 07:39 AM
Also, I've never even used "$foruminfo['forumid']" either.. I've only used "$forumid" or "$forum[forumid]".. I'm not saying "$foruminfo[forumid]" is wrong, but is there any actual benefit in using it over the shorthand, Dismounted?
I've mostly used $foruminfo because that's what I've learned to do from coding plugins.
I also don't understand why single quotations are required in the code? (e.g. $foruminfo['forumid']).
When you don't use single quotations (or even double), PHP searches for a constant with that name, then it accesses that string of the array. It will emit an E_NOTICE error if it doesn't find a constant (although you won't see this error on most servers). It is also slower.
TheMilkCarton
06-21-2007, 09:50 AM
I've mostly used $foruminfo because that's what I've learned to do from coding plugins.
When you don't use single quotations (or even double), PHP searches for a constant with that name, then it accesses that string of the array. It will emit an E_NOTICE error if it doesn't find a constant (although you won't see this error on most servers). It is also slower.
Thanks! You're so informative!
Now if the OP would respond so we (meaning you :p) can figure out what's going wrong. :D
ski diva
06-21-2007, 11:39 AM
Okay, I'm here.
What I'm getting now is the ads that are linked to the second zone in the code are appearing in all cases -- that is, across all forums. This applies to the forum that I want to get its own ad, too without the others appearing (this is the first zone in the code). The ad that I want delivered to that zone specifically is not appearing at all.
Weird, huh?
BTW, Dismounted, I took your advice and only put in the block of code you gave me once; I guess I misunderstood when you said I needed multiple zones. I thought that meant I had to put in the code in for all the multiple zones.
nanaimobar
06-21-2007, 10:05 PM
I use an iframe tag and invocation code to display ads on my word search puzzle pages.
First off, I'm not a coder by any stretch of the imagination and I don't know if what I did will work in your instance but it worked for me to rotate ads.
I simply created a new html page, place the invocation code in it (generated by openads for javascript) and set a metatag refresh time in it.
The ads are displayed in a page using an html iframe tag in that page to call the invocation code html page.
The html page with the invocation code:
1)create new html page
2)place metatag for refresh near top.
3)place invocation code from openads below metatag for refreshing ads in iframe.
4)save it as: WhateverYouWantToNameYourFile.html
Invocation code was the code generated by openads 2.0 for javascript. I simply copied that into a new HTML page and named it something. Above the invocation code I placed the metatag for refresh the invocation code and set a time in it.
The metatag is: <META HTTP-EQUIV="refresh" CONTENT="60">
The 60 simply is the time in seconds.
Also in the page with the invocation code, at the very top, I have:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
which works for me.
Iframe tag:
<iframe height="140" width="760" scrolling="no"frame frameborder="0" border="0px" src="WhateverYouWantToNameYourFile.html"></iframe>
Be sure to include the quotes in this example.
Above code for iframe to be placed in whatever page you want the adds to refresh or rotate.
I added the height and width because I don't know how to have an iframe automatically fit an ad. I set scrolling to no to eliminate the scroll bars which appear in the iframe. The frameborder numbers are set to 0 so no border appears.
You can see it in action here (http://www.punzhu.com/main-puzzles.html).
All my word search puzzle pages have the iframe code I mentioned above so if you want to see other examples just choose one of the puzzles. The ads will refresh in 60 seconds without changing the puzzle.
For the majority of ads on my forum board I use vb admanagement (https://vborg.vbsupport.ru/showthread.php?t=131150&highlight=admanagement) with openads. It works fairly straightforward.
Dismounted
06-22-2007, 06:00 AM
You do know the use of iFrames are highly not recommended, it's bad coding style. Also, he's not trying to rotate ads, he's trying to get DIFFERENT ads in different forums.
ski diva
06-22-2007, 11:10 AM
Dismounted, you got that exactly right! Rotating ads IS NOT the problem.
There HAS to be a way to solve this, though, wouldn't you think? :confused:
shunx91
09-18-2007, 10:25 PM
Replace the two instances of "zone:3" with:
zone:<if condition="$foruminfo['forumid'] == FORUMID">ZONENUMBER<else />3</if>
To do this with multiple forums:
zone:<if condition="$foruminfo['forumid'] == FORUMID">ZONENUMBER<else /><if condition="$foruminfo['forumid'] == FORUMID2">ZONENUMBER2<else />3</if></if>
Hi Dismounted;
I tried what you posted but it doesn't work.
<!--/* Openads Javascript Tag v2.3.39-beta */-->
<!--/*
* The backup image section of this tag has been generated for use on a
* non-SSL page. If this tag is to be placed on an SSL page, change the
* 'http://www.clubwrx.net/openads/www/delivery/...'
* to
* 'https://www.clubwrx.net/openads/www/delivery/...'
*
* This noscript section of this tag only shows image banners. There
* is no width or height in these banners, so if you want these tags to
* allocate space for the ad before it shows, you will need to add this
* information to the <img> tag.
*
* If you do not want to deal with the intricities of the noscript
* section, delete the tag (from <noscript>... to </noscript>). On
* average, the noscript tag is called from less than 1% of internet
* users.
*/-->
<script type='text/javascript'><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://www.xxxxx.net/openads/www/delivery/ajs.php':'http://www.clubwrx.net/openads/www/delivery/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=4");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://www.clubwrx.net/openads/www/delivery/ck.php?n=a4f64f41&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://www.clubwrx.net/openads/www/delivery/avw.php?zoneid=4&cb=INSERT_RANDOM_NUMBER_HERE&n=a4 f64f41' border='0' alt='' /></a></noscript>
It seems like the key variable lies in the phrase document.write ("?zoneid=4");
Is there any way to use if and else statements before and after this entire line?
Here's the pseudo code:
If (forumid == x)
document.write ("?zoneid=4");
else if (forumid == y)
document.write ("?zoneid=5");
else
document.write("?zoneid=6");
Can you tell me how to write the if and else statement in the java script provided by openads?
Dismounted
09-19-2007, 05:10 AM
You'll have to tell me the forum IDs...
shunx91
09-19-2007, 06:27 AM
for exmaple if the forum ids are 12 and 22, what would the code look like? Thanks ahead for your help btw.
Dismounted
09-19-2007, 08:06 AM
Find:
document.write ("?zoneid=4");
Replace With:
document.write ("?zoneid=<if condition="$foruminfo['forumid'] == 12">4<else /><if condition="$foruminfo['forumid'] == 22">5<else />6</if></if>");
doug97gxe
10-17-2007, 05:40 PM
code turned out a little different for me.. but Dismounted gave the general road map
document.write ("&<if condition="$foruminfo['forumid'] == 45">what=zone:1</if>");
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.