bluetoother Posted October 17, 2007 Share Posted October 17, 2007 what is the procedure to build ads system,,i want to write javascript code and give it to other sitesto show ads coming from my websiteand i want to create a mysql database in my web site to store information about the ad ( who view it , view time , how many times ad viewed )what is the right way to build such system ? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 17, 2007 Share Posted October 17, 2007 That's a pretty major question. I assume you need some sort of user accounts or affiliates or whatever for people who show the ads on their pages, so you need to give those people some way (a key or something) so that you can track who is requesting the ads. So the code on their page to fetch the ads will need to include something identifying them, and you probably also will want to store the IP address or domain name of that site along with the key so you can tell if someone is trying to use a key for someone else. Aside from all the authentication issues, you'll probably need an AJAX client on the page hosting the ad that can make a request to your server, with all of that information, and you send it back a series of ads, however you want to do that. Then you will need a click handler on the ad link to register again with your server that the ad was clicked on, and to send the same information back so that you can track it all. Link to comment Share on other sites More sharing options...
bluetoother Posted October 18, 2007 Author Share Posted October 18, 2007 i think you complicated it ,,i dont want to be google i want to give other ppl who own web sites a code that might look like this : <sricpt src="http://my-website.com/js_ad_functions.js"><sricpt>run_ad();</script> then i want to write some functions in that javascript filethat bring some php page from my web site root and show itwhen some page that host my ad run the run_ad() functionthe php page contain scripts to store the request time and the domain name on the ad viewer web siteiam sure i have to use AJAX in the javascript filebut i think it is harder to generate ads related to the page like what google does Link to comment Share on other sites More sharing options...
justsomeguy Posted October 18, 2007 Share Posted October 18, 2007 Right, I think everything I described does what you want to do. That doesn't even begin to touch on targeted ads, if you wanted to do that you would need to have your ad server get the page that is requesting the ad and parse it up to look for keywords that may be associated with ads. Link to comment Share on other sites More sharing options...
redwall_hp Posted October 19, 2007 Share Posted October 19, 2007 So basically you want to generate JavaScript with PHP?So you have you JS/PHP file "js_ad_functions.php" like this: <?phpHeader("content-type: application/x-javascript");?>document.write("<?php echo 2+2; ?> is equal to four"); So people can put <sricpt src="http://my-website.com/js_ad_functions.php"> ? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.