Web Hosting Talk







View Full Version : Google analytics in style sheet?


Dan B
05-02-2010, 09:26 PM
I have about 20 html files, no template. When I need to add a menu, I have to open all 20 files.

I would now like to add google analytics to my site. Is it possible to add it in the style.css because I know thats the only thing that is on all the pages.

If I put it in the index, the stats would only gather from the index page right?

WickedFactor
05-02-2010, 09:33 PM
It won't work if you put it in the css file as the analytics code is js. Don't think you have any other options but to open all 20 html files at some point, if you want analytics tracking every page.

Dan B
05-02-2010, 09:40 PM
Thought so :( Thanks!

iserve4web
05-03-2010, 12:49 AM
no. there is a way. not on the css files on the html itself.

PaulM
05-03-2010, 09:04 AM
No - as there would be no way for analytics to tell you which page your on... But you can use a php include so you only have to make the one file...