Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk
Welcome to the GeekTalk Webmaster Discussion Forums from GeekVillage.com

Click Here To Register. It's Free!

Go Back   geek/talk: Web publishing business discussion > YOUR REVENUE: Making Money On The Internet > Making Money with CPC and/or CPM Programs
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 07-21-2001, 09:57 AM   #1
masm50
Registered User
 
masm50's Avatar
 
Join Date: May 2001
Location: UK
Posts: 822
Default Doubleclick random number generator?

Hi all,

I use Bulletmedia as my ad network, and theys erve ads through DoudleClick DART. So that is my code.

I need to add a random number generator to the add code so it writes a 5 digit number different for ever page view. I need it to write the same number 4 times in the code.

I think you can do this with javascript. I would appreciate any help with it, as I'm a complete newbie to JavaScript.

Cheers

Tim

Become a musician - Musicware
http://www.musicware.dial.pipex.com/
masm50 is offline   Reply With Quote
Old 07-21-2001, 05:49 PM   #2
AdRatesOnline
Registered User
 
Join Date: Apr 2001
Location: Mountain View, CA US
Posts: 68
Default

Hi, I think the following code should generate a random 5 digit number. Just add your adnetwork code in the "document.write" part of the code inserting '+RN+' wherever you want the random number inserted. If you code is more than just a image and click URL you can add more document.write lines. HTH


Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
RN = Math.floor(Math.random() * (1 + 99999 - 10000) + 10000);
document.write('<a href="INSERT YOUR CLICK URL HERE?'+RN+'">');
document.write('<img src="INSERT YOUR IMAGE URL HERE?'+RN+'"></a>');
// End -->
</SCRIPT>
AdRatesOnline is offline   Reply With Quote
Old 07-23-2001, 12:41 PM   #3
masm50
Registered User
 
masm50's Avatar
 
Join Date: May 2001
Location: UK
Posts: 822
Wink Thanks John- but I'm still a bit stuck

Thanks a lot for your help John!

But I'm still stuck on how to implement that random number generator.

Here's the code I have to add to my pages:

<IFRAME SRC="http://ad.doubleclick.net/adi/musicware.bulletmedia/;sz=468x60;ord=19761534551833420?" name="frame1" width="468" height="60" frameborder="no" border="0" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no">
<SCRIPT language="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=19761534551833420?">
</SCRIPT>
<NOSCRIPT>
<A HREF="http://ad.doubleclick.net/jump/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=19761534551833420?"><IMG SRC="http://ad.doubleclick.net/ad/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=19761534551833420?" border=0 height="60" width="468"></A>
</NOSCRIPT>
</IFRAME>

I have to replace every time the number 19761534551833420 with the random generated number that is 5 digits or more.

Thanks in advance

Tim

Make yourself a better musician - Musicware
http://www.musicware.dial.pipex.com/
masm50 is offline   Reply With Quote
Old 07-23-2001, 07:45 PM   #4
AdRatesOnline
Registered User
 
Join Date: Apr 2001
Location: Mountain View, CA US
Posts: 68
Default

Ok, you could try the following ...

Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
RN = Math.floor(Math.random() * (1 + 99999 - 10000) + 10000);
document.write('<IFRAME SRC="http://ad.doubleclick.net/adi/musicware.bulletmedia/;sz=468x60;ord='+RN+'?" name=\"frame1\" width=\"468\" height=\"60\" frameborder=\"no\" border=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" SCROLLING=\"no\">');
document.write('<SCRIPT language=\"JavaScript1.1\" SRC="http://ad.doubleclick.net/adj/musicware.bulletmedia/;abr=!ie;sz=468x60;ord='+RN+'?"></SCRIPT></IFRAME>');
// End -->
</SCRIPT>
<NOSCRIPT> 
<A HREF="http://ad.doubleclick.net/jump/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=12345?"><IMG SRC="http://ad.doubleclick.net/ad/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=12545?" border=0 height="60" width="468"></A> 
</NOSCRIPT>
... IE 3.0b2 and higher should understand the <IFRAME> tags, all other Javascript enabled browsers should output the Javascript code between the IFRAME tags (May also output the 1st IFRAME tag but is should be ignored by the browser) and all others should output the code between the <NOSCRIPT> tags. So long as you are using Javascript to generate the random number I don't think you can add it to the code in the <NOSCRIPT> tags since that is for browsers that don't support Javascript.

For rich media code including Javascript you may want to consider generating the random number on the server side instead of with Javascript. In other words using something like ASP, PHP or SSI. For example, if your server supports PHP, you could add something like the following before the code ...

Code:
<?php

srand((double)microtime()*1000000); 
$random = rand(10000,99999);

?>
and then insert the following in your page ...

Code:
<IFRAME SRC="http://ad.doubleclick.net/adi/musicware.bulletmedia/;sz=468x60;ord=<?php echo $random; ?>?" name="frame1" width="468" height="60" frameborder="no" border="0" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no"> 
<SCRIPT language="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=<?php echo $random; ?>"></SCRIPT> 
<NOSCRIPT> 
<A HREF="http://ad.doubleclick.net/jump/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=<?php echo $random; ?>?"><IMG SRC="http://ad.doubleclick.net/ad/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=<?php echo $random; ?>?" border=0 height="60" width="468"></A> 
</NOSCRIPT> 
</IFRAME>
If SSI is enabled on your server, you could add the following line where you want your banner on your page ...

Code:
<!--#include virtual="/cgi-bin/cacheburst.cgi"-->
and then create a file in your cgi-bin named cacheburst.cgi that contains something like the following ...

Code:
#!/usr/bin/perl
 
srand(time ^ ($$+($$<<15)));
my $random = int(rand(100000));
 
print "Content-type: text/html\n\n";
print <<BANNERCODE;
 
<IFRAME SRC="http://ad.doubleclick.net/adi/musicware.bulletmedia/;sz=468x60;ord=$random?" name="frame1" width="468" height="60" frameborder="no" border="0" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no"> 
<SCRIPT language="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=$random?"></SCRIPT> 
<NOSCRIPT> 
<A HREF="http://ad.doubleclick.net/jump/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=$random?"><IMG SRC="http://ad.doubleclick.net/ad/musicware.bulletmedia/;abr=!ie;sz=468x60;ord=$random?" border=0 height="60" width="468"></A> 
</NOSCRIPT> 
</IFRAME> 

BANNERCODE
I hope one of these works for you!
AdRatesOnline is offline   Reply With Quote
Old 07-24-2001, 03:52 AM   #5
masm50
Registered User
 
masm50's Avatar
 
Join Date: May 2001
Location: UK
Posts: 822
Default THANKS!

You've been a lot of help,

THANKS!

Cheers

Tim
masm50 is offline   Reply With Quote
Old 07-24-2001, 09:27 AM   #6
LastActionHero
Registered User
 
LastActionHero's Avatar
 
Join Date: Jun 2001
Location: New Delhi, India
Posts: 615
Default

A small question. Why is a random number required with doubleclick code? Do they ask you to do so? Why?
LastActionHero is offline   Reply With Quote
Old 07-24-2001, 03:48 PM   #7
masm50
Registered User
 
masm50's Avatar
 
Join Date: May 2001
Location: UK
Posts: 822
Default They asked me to do it

LastActionHero,

Yes, they asked me to put this random number generator in my code. They said it is to stop caching.

That's all I know I'm afraid,

Cheers

Tim

Improve your music skills - Musicware
http://www.musicware.dial.pipex.com/
masm50 is offline   Reply With Quote
Old 07-24-2001, 04:06 PM   #8
dethkultur
Registered User
 
Join Date: Apr 2001
Posts: 4
Default

You can also right click-view source on this page, I think these ads on the forum use a jscript random thing.
dethkultur is offline   Reply With Quote
Old 07-24-2001, 07:03 PM   #9
Czar

Webmaster
 
Join Date: Aug 1999
Location: Gold Coast, Queensland, Australia
Posts: 9,507
Default

Quote:
Yes, they asked me to put this random number generator in my code. They said it is to stop caching.
It's interesting that they didn't provide this themselves, or direct you as to where such code can be found.

Still, at least you have connections in all the right places who are ready and willing to offer their assistance.

Thanks John!
__________________
Czar

Follow Geek/Talk's Twitter Feed and Facebook Page to stay up to date with new discussion threads and online ad industry highlights.

Important GeekVillage Links: Home | Rules | Posting Guide | Report Trouble | Feedback | Advertise on GV
Czar is offline   Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
random number insertion and phpadsnew masm50 Making Money with CPC and/or CPM Programs 1 08-30-2004 02:22 PM
Random info Javascript generator pointsi Web Design and Webmaster Issues 2 03-04-2004 11:05 AM
DoubleClick to shed 10% of workforce Czar Making Money with CPC and/or CPM Programs 1 03-21-2001 10:19 AM
Random Keywords Generator diederik Web Design and Webmaster Issues 0 06-26-2000 12:18 PM
doubleclick bottom banner??? notibrian Making Money with CPC and/or CPM Programs 4 02-07-2000 12:49 AM

Please support our advertisers. They ensure our survival.

All times are GMT -5. The time now is 01:26 AM.


GeekVillage.com is copyright © 1998-2015 Curiosity Cave - Science gifts for clever kids. All rights reserved.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.