Forum Moderators: martinibuster

Message Too Old, No Replies

Adsense code in server side include

is that ok to google? hard to update..

         

silverbytes

12:55 am on Jun 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you put the adsense code in a server side inlude to ease the mantainance? does that work and is it allowed by google?

any experiences?

GrantNZ

1:09 am on Jun 21, 2004 (gmt 0)

10+ Year Member



Sure you can.

Many would be using Server Side Includes to include their Google code - saves time when you want to update your code, or when Google wants you to, because they've changed theirs, e.g. Google recent WebSearch code glitch.

Jenstar

1:10 am on Jun 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, as long as you aren't changing the code. Many here use SSI for AdSense.

silverbytes

2:27 am on Jun 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks.
My server doesn't support it I recently tried...
can that be possible?!

conroy

2:34 am on Jun 21, 2004 (gmt 0)

10+ Year Member



There is a good chance you just aren't setting it up right. If you are using it on .html or .htm pages you probably have to modify your .htaccess file to make it work. Also, there are different types of includes, file includes, virtuals etc. which each work a little differently, and if 1 thing is off then they won't work.

Have you actually contacted your host to verify that they are not supported or did you just try it and they didn't work?

Jenstar

7:22 am on Jun 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Changing your URLs to end with .shtml will usually make SSIs work.

silverbytes

8:25 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



with shtml works.
the problem is that my pages are all .htm and cant move to shtml all my pages...

I need to insert that ssi in my htm pages... does anybody know how to?

Tried a library object (Dreamweaver) with the include but doesn't work for me...

gethan

9:00 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add the 2 lines to .htaccess placed in the root directory:

addtype text/html .htm
AddHandler server-parsed .htm

Will mean that every page is parsed as SSI by apache (possibly slowing down your website) - but I think that is what you are looking for.

bhartzer

9:01 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SSI is fine, it works well with Adsense.

europeforvisitors

9:07 pm on Jun 22, 2004 (gmt 0)



Those of you who are using FrontPage can achieve an SSI effect with Shared Borders or by using FrontPage Web Components > Included Content > Page.

silverbytes

12:49 pm on Jun 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Those of you who are using FrontPage can achieve an SSI effect with Shared Borders or by using FrontPage Web Components > Included Content > Page.

And for those who don't use Frontpage, would you mind to tell us what code that inserts? Maybe we just can paste that code..

silverbytes

1:05 pm on Jun 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add the 2 lines to .htaccess placed in the root directory:
addtype text/html .htm
AddHandler server-parsed .htm

Will mean that every page is parsed as SSI by apache (possibly slowing down your website) - but I think that is what you are looking for.

Well, no. What I want is to insert a piece of code without the weight of the whole script, just a reference to that. I propoused SSI but don't want to scrify my whole site speed for that...
Is there ohter alternative? Workarounds?