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.