Unstoppable Domains โ€” Expired Auctions

How Google ad script work?

Spaceship Spaceship
Watch

animeenergy

Account Closed
Impact
0
Hello,
I am new to webdesign and all the scripting stuffs.

Can someone explain to me..in plain language how a one line script like

<script type="text/javascript" src="http://shots.snap.com/ss/48f31b069eeb8dcbc413a28eadd21247/snap_shots.js"></script>

from snap can change the landscape of the website?


amazing!!!
and how does google adsense script work? How do they know what ads to put on?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
There's no way we can challenge Google's script.
 
0
•••
First of all please only post threads that are relevant to webmasters in webmaster tutorials section.

Back to the question.

To understand how google adsense delivers the contextual advertisement. You need to understand the system of delivering plain text banners as well as crawling the pages for content.

It is not easy and it isn't that tough too. Depends on your knowledge on the subject.

But yeah if you are looking for something like that then a good developer will charge around 50K to 100K USD for it.

Thanks.
 
0
•••
animeenergy said:
<script type="text/javascript" src="http://shots.snap.com/ss/48f31b069eeb8dcbc413a28eadd21247/snap_shots.js"></script>

from snap can change the landscape of the website?

The script can output text which is interpreted by the web browser. It behaves just as if you allowed snap to come along, edit your HTML, puting anything that they wanted in place of the script.

animeenergy said:
and how does google adsense script work? How do they know what ads to put on?

They probably use something called HTTP_REFERRER, which will be sent to google's server when the adsense script is loaded. This would allow them to work out the page that is including the adsense script. They then visit the page, read the contents, work out what ads would be best for that page, and display them.
 
0
•••
qbert220 said:
animeenergy said:
<script type="text/javascript" src="http://shots.snap.com/ss/48f31b069eeb8dcbc413a28eadd21247/snap_shots.js"></script>

from snap can change the landscape of the website?

The script can output text which is interpreted by the web browser. It behaves just as if you allowed snap to come along, edit your HTML, puting anything that they wanted in place of the script.

animeenergy said:
and how does google adsense script work? How do they know what ads to put on?

They probably use something called HTTP_REFERRER, which will be sent to google's server when the adsense script is loaded. This would allow them to work out the page that is including the adsense script. They then visit the page, read the contents, work out what ads would be best for that page, and display them.
Wrong formula :(
 
0
•••
0
•••
0
•••
-Nick- said:
Means that is not the way the contextual advertising works :)

So how do you think it works then?
 
0
•••
It regularly crawls the pages and checks it against the bidded keywords in their existing advertisers database and then selects which ads goes where. It does not crawls a page when the page loads and requests the ads.

If it was that scenario it would take ages to load an ad on the page.

Rest is not what I can explain here.
 
0
•••
I didn't say google's crawler visited the referring page each time the javascript was loaded. I was trying to give the OP a simple description of the basic principles of how it works.
 
0
•••
:( I have the thing in quote. So no comments from me :) I am not really trying to prove anything :) Thanks. And sorry if you feel offended :)

Just trying to be helpful :)
 
0
•••
-Nick- said:
I have the thing in quote
No you don't. You have misinterpreted the meaning of my original post. I did not say this happens every time a page is loaded. I know Google do not visit the referring page each time it is loaded, but I left that information out of my original reply for simplicity.

-Nick- said:
I am not really trying to prove anything
I posted what I still believe to be an accurate response. You quoted the whole of my response and said "Wrong Forumula". From my point of view this looks like you are saying my whole post was incorrect. I still believe it is correct. Yes, there are further complexities, but I was trying to keep the response simple as requested by the OP.

-Nick- said:
And sorry if you feel offended :)
I'm not offended. I want people to get the right idea about what is being discussed in this thread. I don't want someone to read a correct statement followed by a response that it is wrong without some discussion as to why the responder thinks that. I don't see that as constructive to anyone's understanding of the topic. I am all for constructive critique - that's how we learn. Had your response described the further complexities that would have been great - a learing opportunity for all.

-Nick- said:
Just trying to be helpful :)
Me too.
 
0
•••
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxx";
/* 728x90, created 9/23/08 */
google_ad_slot = "8832322804";---------what is this
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"--------what is this?
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">--and how this work?
</script>

*********************************
Sorry-I opened a new can of worm. Hope Google does not come knocking on our doors.
Okay, for someone who wants to learn scripting, the typical codes above tell me what?

As I said ,so amazing for 7+ lines of code and work magic.
What behind the scene?
 
0
•••
Well - I don't think anyone will be able to explain it "Exactly" because Google is paying their developers to keep them at the top of their game all of the time ... Like them or not , Google Technology and services are simply amazing.

The actual expression is "HTTP_REFERER" not "HTTP_REFERRER" ;) It's a common typo (Even though referrer is the actual Dictionary word).

I'm not sure if it is actually used or not. Google does have to know where the "requests" are coming from though - And as Nick stated , They are actually crawling the web page to gather data to base the results on.

I've thought about this in the past myself - and all it did was make my old school brain hurt :laugh:

Not all websites showing Adsense ads are listed in/on googles search results ... But yet they are gathering the data. At one point I was thinking they do actually store a dbase of related keywords/categories somewhere (When a certain website is banned/blocked - They know that as well) - But the ads change pretty quickly if you change the entire content overnight (not suggested) .... It almost has to be something they are doing on the fly IMO ~
If they were grabbing "location.href" it would make more sense to me.





There is no great answer AFAIK for "google_ad_slot" other than it is Not the same as "google_ad_channel" like the old script showed. They change the script pretty often it seems to me ... Perhaps it's just an easier way for Google to know what settings to use.
 
0
•••
Pretty scary...google can "see" what you are doing

So if you have a domain name called Sex porn sex.com but in the content is about religion, will the site be banned?

as they say, don't judge the book by its cover.
 
0
•••
Not necessarily - Their Algo's for what is allowed and what isn't seems just as difficult to figure out as your original question :laugh: There are plenty of Adult sites out there using google ads.
 
0
•••
The first part:

Code:
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxx";
/* 728x90, created 9/23/08 */
google_ad_slot = "8832322804";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
sets some variables. These are used by the second part.

The google_ad_client is the publisher ID. Every person who signs up with Google adsense has a unique publisher ID.

The google_ad_slot is the ad slot identifier. When a publisher creates an ad unit on the adsense site, it is given a unique ad slot identifier. The ad ad unit defines things like the colours and borders displayed in the ad, whether it shows text, images or both etc.

The second part:

Code:
<script type="text/javascript"--------what is this?
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
loads the ad script from Google's server. It will be this script that shows the actual ad. This script will be passed the referrer, which I think is probably used (but I can't be certain) to determine the page on which the ad is being displayed. This script will output the HTML to display the ad.

Mark said:
Not all websites showing Adsense ads are listed in/on googles search results ... But yet they are gathering the data.
The adsense spider is a different robot to the normal Google search spider. It uses a different user-agent, and different IPs. I don't believe there is any data shared between the 2 (but I could be wrong on that).
 
0
•••
Okay I am fed up of this qbert's posts and as it is really going in wrong direction I will post here what the real thing is.

qbert220 said:
The second part:

Code:
<script type="text/javascript"--------what is this?
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
loads the ad script from Google's server. It will be this script that shows the actual ad. This script will be passed the referrer, which I think is probably used (but I can't be certain) to determine the page on which the ad is being displayed. This script will output the HTML to display the ad.
Where again he is wrong.

And why I am right. Because I have myself developed the system for 3 network till now :D

So here is how it goes.

1) When the code is loaded it has some parameters being passed like BGcolor Border color etc to the JS code that resides on the server. It doesn't needs any other info here whatsoever not even HTTP refferer.

Because remember PHP or any server side scripting language has already been executed by the time the ads or the page on which the ads are shown is loaded. So there is no control whatsoever which will detect this Referrer etc.

Now this JS script passes the Color and other attributes to the Another PHP or Similar scripting language. And this is the page that loads into an iframe.

This page now again has fresh control over the Global and SERVER variables. So it detects the IP, Referrer, Browser agent.. etc...etc.... and registers the impression over here. The click side scenario is again different as it has encoded links which will pass the click through another layer that will log other things and redirect the visitor to the Destination URL.

In the meantime back to that layer where the attributes where being sent. This layer has fresh scripting control now so it can access HTTP referrer and there is an already prepared database for contextual ads for that particular sitehost. And it checks if the advertisers from that match have some pending budget to be spent today. If yes then that ads goes in there. The pending ads, the bids, the geo targetting and all things are advertisers side so will skip it here.

Now how that matches table is created is that when this script is called for the very first time and it finds no matches with its advertisers. It puts up that siteID into the que for crawling later on. Where their bots will go fetch the Text and see if that text matches the ongoing campaigns that are running in the network. And thus this prepares the contextual data table.

Now that is why I was saying wrong formula. When I read the below thing.
qbert220 said:
animeenergy said:
<script type="text/javascript" src="http://shots.snap.com/ss/48f31b069eeb8dcbc413a28eadd21247/snap_shots.js"></script>
from snap can change the landscape of the website?
The script can output text which is interpreted by the web browser. It behaves just as if you allowed snap to come along, edit your HTML, puting anything that they wanted in place of the script.


The scope of Javascript is on client side that is the browser of the visitor.

The scope of server side scripting is on server side that is the ads system.

Sorry if anything above is confusing or not understandable. But as I mentioned earlier. It isn't a thing that is just like sit and code it out. Also it isn't a beginner or an intermediate level of programming that we are talking about here. When you don't know the scope of the programming language that you are referring to in your examples then there is no way you will ever be able to achieve what you are trying to do.
 
0
•••
I think you are agreeing with me. You are saying that the ad script displays an iframe. The contents of that iframe is generated by a script, and that script uses the referrer to detect the page that is is being displayed on. Right?

Because remember PHP or any server side scripting language has already been executed by the time the ads or the page on which the ads are shown is loaded. So there is no control whatsoever which will detect this Referrer etc.
I had assumed that the js itself was dynamically generated (and therefore could use the referrer), but it seems this is not the case. The iframe method makes more sense.
 
0
•••
Mark said:
Not necessarily - Their Algo's for what is allowed and what isn't seems just as difficult to figure out as your original question :laugh: There are plenty of Adult sites out there using google ads.


Now I am really really confuse.

Maybe we should ask google.

Anyway thanks guys/gals.
 
0
•••
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back