|
Adding google ads into css?
03-28-2008, 08:05 PM
|
Adding google ads into css?
|
Posts: 162
Name: Colton
Location: Utah, USA
|
I would like google ads to appear at the bottom of each page. Is there a way to insert the code into my css file? http://www.outdoorhighadventure.com/style.css Thanks!
__________________
Colton
Wild Backpacker
Please login or register to view this content. Registration is FREE
|
|
|
|
03-28-2008, 08:22 PM
|
Re: Adding google ads into css?
|
Posts: 1,228
|
You won't be able to insert it into your CSS file. One solution (and I'm not sure if it's the best solution) that I've seen on the Google forums is to use an iframe to call a page with your AdSense code on it. Otherwise, I'd recommend a CMS.
|
|
|
|
03-28-2008, 08:30 PM
|
Re: Adding google ads into css?
|
Posts: 162
Name: Colton
Location: Utah, USA
|
Elaborate more on the iframe and CMS. Can I add an iframe in the css? If not, I might as well insert the code on every page. Also, I have no clue what CMS is. Thanks.
__________________
Colton
Wild Backpacker
Please login or register to view this content. Registration is FREE
|
|
|
|
03-28-2008, 09:59 PM
|
Re: Adding google ads into css?
|
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
It is better not to use iframes, IMO. You'd be better off with server-side includes, such as the ones in PHP.
|
|
|
|
03-28-2008, 10:14 PM
|
Re: Adding google ads into css?
|
Posts: 162
Name: Colton
Location: Utah, USA
|
Okay, thanks. I think I'll just add the code manualy to each page then.
__________________
Colton
Wild Backpacker
Please login or register to view this content. Registration is FREE
|
|
|
|
03-29-2008, 04:43 PM
|
Re: Adding google ads into css?
|
Posts: 7
Location: Newberg, OR
|
CMS is a content management system that helps you organize the files of your website.
|
|
|
|
03-29-2008, 06:32 PM
|
Re: Adding google ads into css?
|
Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
If you have a server side language, use include() or similar instruction to append an external file to your page
If your web server supports SSI (Server Side Includes), you can do it even without any programming language [ http://httpd.apache.org/docs/1.3/how...standardfooter ]
Stay away from an iframe. An iframe is like an empty web page.
The adsense server would not know what your site talks about, as your iframe will be empty. Beside, iframes are baaaad.
__________________
Only a biker knows why a dog sticks his head out the window.
|
|
|
|
03-29-2008, 09:37 PM
|
Re: Adding google ads into css?
|
Posts: 424
Name: Denny
Location: In a can...
|
Yup... I use includes for a lot of things. Without setting up a content management system. This is an excellent way to archive this.
Create an .inc file with the Google script only. NO DOC TYPE.
Save it as googleadds.inc
Add this code were you want the add to appear. This method only works with file extensions .php not .htm
Code:
<?php include("includes/googleadds.inc"); ?>
I'm not sure what account package you have with Go Daddy but, I'm pretty sure it runs Linux and accepts php extensions unless you are using Windows just save a page as test.php with the include and see.
__________________
.
Village Idiot
Last edited by Sydpix; 03-29-2008 at 09:44 PM..
|
|
|
|
03-30-2008, 03:06 PM
|
Re: Adding google ads into css?
|
Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
|
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|
|
|
|
03-30-2008, 11:54 PM
|
Re: Adding google ads into css?
|
Posts: 162
Name: Colton
Location: Utah, USA
|
MY hosting service doesn't support php, so would it not work then? Thanks for the help!
__________________
Colton
Wild Backpacker
Please login or register to view this content. Registration is FREE
|
|
|
|
03-31-2008, 03:42 AM
|
Re: Adding google ads into css?
|
Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
|
do they support SSI?
because you can use exactly the same methods.
put the following code into a .htaccess file and test to see if an include works
Code:
AddType text/html .htm .html .shtm .shtml
AddHandler server-parsed .htm .html .shtm .shtml
Options Indexes FollowSymLinks Includes
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|
|
|
|
03-31-2008, 12:09 PM
|
Re: Adding google ads into css?
|
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
I think there is a way to do this in ASP also, though I'm not very familiar with that language. ASP works in a similar manner to PHP, in that its code is embedded into HTML.
Chrishirst, I believe that .htaccess files are only a part of Apache. He may not be hosted on Apache, because when was the last time you heard of an Apache host that does not support PHP? PHP is included by default with Apache, and I can't imagine a reason to take it off.
|
|
|
|
03-31-2008, 12:38 PM
|
Re: Adding google ads into css?
|
Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
|
Quote:
|
I believe that .htaccess files are only a part of Apache.
|
Quite Correct
Quote:
|
He may not be hosted on Apache, because when was the last time you heard of an Apache host that does not support PHP
|
You see the trick to giving useful & appropriate answers is to first know what you are dealing with.
HTTP Request
Code:
GET / HTTP/1.1
Host: www.outdoorhighadventure.com
Connection: close
Accept: */*
User-Agent: WebBug/5.0
HTTP Response
Code:
HTTP/1.1 200 OK
Date: Mon, 31 Mar 2008 15:50:42 GMT
Server: Apache/1.3.39 (Unix) mod_jk/1.2.26 mod_layout/3.2 mod_gzip/1.3.19.1a mod_throttle/3.1.2
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
So there you have an Apache host with PHP disabled.
Not every hosting company will have PHP on with all hosting packages. Godaddy for example provide Apache hosting without PHP and Windows hosting with ASP disabled.
Just because you can get them bundled for the home hosting market or development server doesn't mean professional hosting companies use the same install bundles.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|
|
|
|
03-31-2008, 12:43 PM
|
Re: Adding google ads into css?
|
Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
|
Quote:
|
I think there is a way to do this in ASP also, though I'm not very familiar with that language.
|
Yes there is and if you click through to the thread I linked to, a way to use ASP includes is there as well.
Quote:
|
ASP works in a similar manner to PHP, in that its code is embedded into HTML.
|
Neither ASP or PHP is "embedded" into HTML.
The server handles the coded instructions and outputs the results in HTML (or XML, javascript, CSS etc)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|
|
|
|
03-31-2008, 02:13 PM
|
Re: Adding google ads into css?
|
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Quote:
|
Neither ASP or PHP is "embedded" into HTML.
|
Sorry if you don't like my semantics, wise guy. PHP and ASP certainly may be "embedded" into HTML, when you code them. The output from the server to the browser certainly is a different matter...
|
|
|
|
03-31-2008, 02:25 PM
|
Re: Adding google ads into css?
|
Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
Quote:
|
Sorry if you don't like my semantics, wise guy.
|
As body language don't go through forum posts, I'll give you the benefice of doubt, but please, no need to be harsh.
It's not just a small semantic twist. If peoples are using the same word to describe different things, no understanding will never be reached as we all will talk about something else.
Beside, Chris is an old and trusted member of this forum, and even if you are angry, he does not deserves to be bashed because he takes time to help you.
Thank you.
__________________
Only a biker knows why a dog sticks his head out the window.
|
|
|
|
03-31-2008, 02:43 PM
|
Re: Adding google ads into css?
|
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Sorry, I didn't mean to offend anyone. It is just that those two languages are described in exactly that manner, as "embedded" into HTML, over and over across the web and elsewhere. My point is, if you had read it carefully, is that even if he is technically correct, it is just a matter of semantics. If I come across as a smartass it's only because I am one 
|
|
|
|
03-31-2008, 02:54 PM
|
Re: Adding google ads into css?
|
Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
And I wasn't accusing you neither.
Not being a native English speaker, I had not grasped the full meaning earlier.
But thank you for the clarification.
Quote:
If I come across as a smartass it's only because I am one
|
Ahaha... Good answer. Well, we are now warned then.
__________________
Only a biker knows why a dog sticks his head out the window.
|
|
|
|
03-31-2008, 08:33 PM
|
Re: Adding google ads into css?
|
Posts: 162
Name: Colton
Location: Utah, USA
|
Being totally honest, most of that discussion went right over my head. You guys are more then willing to argue about 'embedding' and other things, but don't worry about helping me! hahaha I'm fine adding it manually to my pages, since I have some other updates I need to do as well. I just wanted to check if there was an easy way, but I guess not. Thanks so much for the help, and please, continue your dicussion without me!
__________________
Colton
Wild Backpacker
Please login or register to view this content. Registration is FREE
|
|
|
|
03-31-2008, 11:04 PM
|
Re: Adding google ads into css?
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
Quote:
|
The adsense server would not know what your site talks about, as your iframe will be empty. Beside, iframes are baaaad.
|
I tried the iframe thing for a while and did notice a significant drop in clicks. Checking the ads caused a major "duh" factor...of course they couldn't be as relevant stuck in an iframe. Being that I have over 10,000 web pages to change by hand, I thought they were a Godsend at first, but no such luck. So i sure wouldn't advise that.
Just thought I'd mention that in case anyone else is thinking of going that route.
|
|
|
|
|
« Reply to Adding google ads into css?
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|