1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Myspace Adsense Code

Discussion in 'Placement / Reviews / Examples' started by rewlie, Jun 3, 2006.

  1. #1
    looks like Google set another sets of code for them :

    <!--* ad server target 3 (google) *-->
    				
    				<script type='text/javascript'>
    					var keywordArray = new Array('astrology,dating,relationship help,chat,depression,life change,coaching,motivation,anxiety,stress 	relief,personality quiz,quit smoking,self defense,intuition,meet people,social,text messaging,workplace,birthday party idea,concert 	ticket,dj,karaoke,music,limousine,bus,mixtapes,mobile,party,portable sound system,restaurant,gift 	certificate,theater,clubs,comedy,dance,raves,drinking,concerts','college,student loans,small business,legal advice,real 	estate,refinance,investing,desktop,computer,gaming,internet,ipod accessory,school,laptop,mp3 players,new york times,photography,theology,video game,volunteer 	work,desktop education,stock,laptop,contemporary art,university,business,marketing,stock trading,volunteer,money,investing,finance,computer 	programming,studies,learning,architecture,politics,advertising,teaching,wall street,fortune,forbes,entrepreneur','acting,fitness,model,cheap dvd,movie,film 	production,new release,science fiction,star wars,mp3 players,download,concert ticket,liquid vitamin,filmmaking,home gym,lord of the 	ring,collectible,poster,horror,alternative music,buy cds,cd storage,dj equipment,free,hip hop,rap,home 	recording,rock,software,classic,player,rental,industry,musical instrument,online,adidas,backpack,converse all 	star,cool,t-shirt,dickies,spa,hoodies,levi,jeans,magazine subscription,nike shoes,skechers,trucker hat','extreme sport,mlb,nascar,ncaa,cycling,ticket,college 	football,espn magazine,gear,sports illustrated,super bowl,throwback,jersey,world cup soccer 	series,wwe,boxing,adventure,camping,equipment,hiking,kayaking,mountain,outdoor sports,sailing,scuba 	diving,skateboard,snorkeling,snowboarding,wakeboard,watersports,whitewater rafting,backpacking,vacation,mountain 	guide,canoe,shooting,hunting,fishing,waterskiing,horses,parks,backpacking,rock climbing,skydiving','rental,dance revolution,everquest,final 	fantasy,gamecube,videogame,playstation,console,sony psp,star wars,galaxies,atari,world of warcraft,x box,chess,controller,antique,cooking,collectible 	art,coin collecting,hobby supply,model airplane,car kit,pc gaming,photography,sport,stamp,toy,woodworking,ceramics,sewing,scrapbook,illustration,crafts,board 	games,adventure,cruise,travel,african safari,airfare,australia,barcelona,beach rental,eurail pass,bicycle tour,france,greece,hiking,italy,travel,trekking 	movies,foreign films,indy films,acting,film,sci fi','buying,car dealer,used dealer,motorcycle accessory,insurance,dale earnhardt,drag racing,gas scooter,go 	kart,,nascar,ticket,pocket bike,scion,sports,honda,atv',''); 	var numKeywordsToCycle = 2;
    				var bucketPercentages = new Array(0.1,0.2,0.1,0.1,0.2,0.1,0.2);
    				var channelIds = new Array('7329724470','4829030436 ','8284300716','1910392839','9258010159','6798883513','2189259108');
    				var bucketIndex = getBucket(bucketPercentages);
    				google_kw_type='broad';
    				google_kw = getKeywordSet(keywordArray[bucketIndex], numKeywordsToCycle);
    				google_ad_channel = channelIds[bucketIndex];
    				
    				google_ad_client = "pub-6426556324701107";
    				google_ad_width = 728;
    				google_ad_height = 90;
    				google_ad_format = "728x90_as";
    				google_ad_type = "text";
    				google_ad_channel +=" Original";
    				google_color_border = "FFFFFF";
    				google_color_bg = "FFFFFF";
    				google_color_link = "0000FF";
    				google_color_url = "008000";
    				google_color_text = "000000";
    
    				function getBucket(bucketPercentages){
    					var cumulativePercentages = getCumulativePercentage(bucketPercentages);
    					var randomNumber = Math.random();
    					for(var i=cumulativePercentages.length-1; i>=0 ;i--){
    						if(randomNumber>cumulativePercentages[i])
    							return i+1;
    					}
    					return 0;
    				}
    				
    				function getCumulativePercentage(percentageArray){
    					var sum=0;
    					var cumulativePercentage = new Array();
    					for(var i=0;i<percentageArray.length;i++){
    						sum += percentageArray[i];
    						cumulativePercentage.push(sum);  
    					}
    					return cumulativePercentage;
    				}
    				
    				function trim(string){
    					return string.replace(/^\s*|\s*$/g,'');
    				}
    				
    				function getKeywordSet(keywordArrayString, numKeywords){
    					var keywordString = '';
    					if(trim(keywordArrayString).length>0){
    						var keywordArray = keywordArrayString.split(',');
    						var keywordSet= new Array();
    						var usedIndexes = new Array();
    						var index = 0;
    						for(var i=0;i<numKeywords; i++){
    							index = getIndexFromRandomNumber(keywordArray.length);
    							while(contains(usedIndexes, index)){
    								index = getIndexFromRandomNumber(keywordArray.length);
    							}
    							keywordSet.push(keywordArray[index]);
    							usedIndexes.push(index);
    						}
    						return arrayToString(keywordSet);
    					} else{
    						return trim(keywordArrayString);
    					}
    				}
    				
    				function arrayToString(array){
    					var string = '';
    					for(var i=0;i<array.length;i++){
    						string += array[i] + " ";
    					}
    					return string;
    				}
    				
    				function contains(array, value){
    					for(var i=0;i<array.length;i++){
    						if(array[i]==value)
    							return true;
    					}
    					return false;
    				}
    				
    				function getIndexFromRandomNumber(arrayLength){
    					var index =  Math.floor(Math.random()*arrayLength);
    					if(index == arrayLength)
    						index = index-1;
    					return index;
    				}
    				</script>
    				<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>
    
    				<script type='text/javascript'>
    					window.frames['google_ads_frame'].location = window.google_ad_url;
    				</script>
    Code (markup):
     
    rewlie, Jun 3, 2006 IP
  2. ahkip

    ahkip Prominent Member

    Messages:
    9,205
    Likes Received:
    647
    Best Answers:
    0
    Trophy Points:
    310
    #2
    where did you get it?
     
    ahkip, Jun 3, 2006 IP
  3. rewlie

    rewlie Active Member

    Messages:
    937
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Hah ?? Of course Myspace.com mate :)
     
    rewlie, Jun 3, 2006 IP
  4. ahkip

    ahkip Prominent Member

    Messages:
    9,205
    Likes Received:
    647
    Best Answers:
    0
    Trophy Points:
    310
    #4
    you mean myspace.com give you the code or you just copy from someone's myspace page?
     
    ahkip, Jun 3, 2006 IP
  5. rewlie

    rewlie Active Member

    Messages:
    937
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    58
    #5
    just look at their source
     
    rewlie, Jun 3, 2006 IP
  6. ahkip

    ahkip Prominent Member

    Messages:
    9,205
    Likes Received:
    647
    Best Answers:
    0
    Trophy Points:
    310
    #6
    now i understand what you mean, i tought it is user's code, my bad :)
     
    ahkip, Jun 3, 2006 IP
  7. rewlie

    rewlie Active Member

    Messages:
    937
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    58
    #7
    i got that one from the top header, that's their own code, of course they can run it, it is their network, what they block are actually the users of myspace, i still dont try to applied it to my account, regarding to what i see before, it's showing the real source,someone has did that before.
     
    rewlie, Jun 3, 2006 IP