Forum Moderators: martinibuster
My doughters become also older and will be soon also surfing around.
I am just implementing to insert the AdSense code by SSI. For example
<!--#include virtual="/cgi-bin/ssi.pl?from=german&insert=300x250" -->
Now I want to convert the other notebooks from my family in AdSense secure notebooks
Thats my USER_AGENT
[ Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; Alexa Toolbar) ]
Seems Alexa changes the USER AGENT string.
I would like to add an unique identifer to the USER_AGENT string, in order that my SSI can sort out my familiy notebooks at inserting the AdSense code.
My server sets 20 year lasting cookies,
but I lost 5 times my own cookie in the last 3 years, so I think cookies are not very reliable.
But why not make the script to look at the(LAN) IP's of the family, and let it decide to show ads.
N
Wow.. So all your PC get a WAN IP from your ISP!
What a waste of IP's :-)
No, he only has one IP, shared by all the PC's on his LAN via his WLAN router... much the same as most home network setups I would imagine. It's actually a very efficient use of IP's ;-)
change the host file on all PC's to an incorrect IP for the URL google uses on ads?
That's an excellent idea. Be careful though, google sometimes use "syndicate2" as a sub-domain. I presume they would all still want to use other google services.
TJ
Put this in the hosts file on all PC's you wish to block ads to (in /windows/system32/drivers/etc/):-
127.0.0.1 googlesyndication.com
It will of course block all ads from all sites, and they are likely to get a browser error when loading pages and have to click a button.
That may be a bit of a pain.
TJ
1.) What is a host file, where to find it
The hosts file contains a list of known domains and their corresponding IP addresses.
Anything in the hosts file overides a DNS lookup.
Putting:-
127.0.0.1 googlesyndication.com
... as a line in a PC's hosts file, will tell the browser on that PC to go to 127.0.0.1 (localhost) for any queries to that domain.
The ads will therefore not show, although it may have un-wanted side-effects. The best thing to do is to try it.
I gave the path to your hosts file (assuming Windows 2000 and up) in my post above. Edit it with notepad. It's a file called "hosts" with no extension.
2.) My family is in general allowed to view AdSense ads, there is only one exception, the AdSense ads with my publisher ID
The above trick will block all adsense ads, and possibly with side-effects, but worth a try.
I can't think of any other way of doing what you want to do, whilst allowing you to view ads on your site, if you don't want to do it with cookies.
TJ
A somewhat more ambitious solution would be to set up a local HTTP proxy for your home network which dynamically rewrites the user agent on all outgoing HTTP requests. Assuming your router can't do such a thing that means you'd probably need to set up a dedicated Linux box or something.
No, he only has one IP, shared by all the PC's on his LAN via his WLAN router... much the same as most home network setups I would imagine. It's actually a very efficient use of IP's ;-)
Yes thats what I also thought, but this was his responce:
My provider gives dynamic IP addresses
Thats why I answered like that.
The hosts file trick is also a good way of doing it..
N
My provider gives dynamic IP addresses
Dynamic simply means it's allocated from a pool ad-hoc, as opposed to static where you are consistently assigned the same IP. Most home DSL/dial-up users are assigned IP's dynamically.
The more I think about it, the more I think that the host file trick may not be the best way - it will cause browser errors in IE... the firefox trick posted above is certainly worth investigating further.
TJ
Alternatively, you could ask your ISP for a static IP. It will cost extra, but it would give you a consistent IP address to check for. The downside of this is that it won't work if you access your site from anywhere other than your home Internet connection - for instance, if you use a laptop while travelling.
If Google can track clicks that are made on your own computer or network of computers, why don't they simply not count those clicks? Let them solve their own problem.
You could install a Norton program with the advert blocker, delete all the default blocker rules and then add just one with your publisher ID in it! You can then switch the adblocker off when you want to work on your site and see the adverts.
(Have I found the first positive use for Norton's ad blocker?!)