Google ads

From ThorstensHome
Revision as of 18:53, 11 September 2012 by WikiSysop (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I want to have the ability to put advertisements on this site and earn money with it. But before I have to put an "Impressum" here according to German law.

Google has two programs for advertisements. There is AdWords for people who want to buy advertising space and AdSense for webmasters who want to earn money by showing advertisements on their pages. I registered there and got a message that I will have to change the A-records of my domains. Then I read and brought Google Ads to my website.

Changing DNS

Google requested me to change some DNS entries to verify that the web pages in question really belong to me. added

@	                 IN A

to, removed

www                      IN A


www                      IN A

On, added to www. Then pointed to google.

Then my mail server did not work any longer. Researching it, the problem was:

# /etc/init.d/postfix start
Starting mail service (Postfix)                                       failed
tstaerk was here. postfix_bin is /usr/sbin/postfix
# /usr/sbin/postfix 
postfix: fatal: parameter inet_interfaces: no local interface found for

Solved this problem by removing all the

@	                 IN A       216.239.


Changing the site

In the MonoBook temPlate, under the toolbox div, I add a div for google ads.

linuxintro:/srv/www/htdocs/skins> diff -rup MonoBook-0.php MonoBook.php
--- MonoBook-0.php 2012-01-04 04:32:27.000000000 +0000
+++ MonoBook.php 2012-08-17 18:35:32.000000000 +0000
@@ -295,6 +295,14 @@ if($this->data['copyrightico']) { ?>
+ </div>
+ <!-- tstaerk: include google ads -->
+ <div class="portlet" id="p-tb">
+ <h5>Advertisement</h5>
+ <div class="pBody">
+ <?php include("/srv/www/htdocs/googleadd-skyscraper.js"); ?>
+ </div>

And I have a php file that displays the ad like this:

linuxintro:/srv/www/htdocs/skins> cat /srv/www/htdocs/googleadd-skyscraper.js
<script type="text/javascript">
<!-- google_ad_client = "ca-pub-5986435568456490";
/* skyscraperblock1 */
google_ad_slot = "9497945662";
google_ad_width = 120;
google_ad_height = 600; //-->
<script type="text/javascript" src="">