Common code - Post ID 140713

User 2137031 Photo


Registered User
37 posts

Is there any way to add common code to the top of each page.

In particular, I use Google Analytics quite extensively. I need to add the google code to the top of each page for their tracking. This helps me on a daily basis to track what people are looking at, where the are coming from and where they leave to.

User 389264 Photo


Registered User
337 posts

Put the code in the footer. I started doing just that long ago and it works very well.
User 164695 Photo


Registered User
17 posts

I've always had the code at the bottom and it works fine.
User 562592 Photo


Registered User
2,038 posts

you can add any html you want using the html tool. Simply declare the head tags and put your code inbetween.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 512728 Photo


Registered User
32 posts

I've added Google Analytics to the footer by simply pasting it in there. I’ve also tried pasting it in the footer, enclosed within head tags (not sure that's right because when I look at the code of the generated pages, the code is at the bottom of the page with the head tags - there's therefore two sets of head tags in the code!)

In any case, neither ways work. My Google Analytics control panel isn't detecting the code.

Any ideas?
User 1970050 Photo


Registered User
151 posts

you can add any html you want using the html tool. Simply declare the head tags and put your code inbetween


Could someone explain this to me? What specifically do you mean by 'html tool' ? What do you mean by 'declare the head tags'?

:cool:
Marilyn near Las Vegas

www.marilynweil.com - VSD, CCD pro, SCC pro
www.elioness.com (web graphics)
www.mdweil.com (travel photos)
User 38401 Photo


Senior Advisor
10,951 posts

@Riz: If you enclose something in head tags then it's telling it to put it in the Head of your site rather than the footer.

@Marilyn: The HTML Tool is what you use to input HTML code into your product details and pages of your shop in the SCC and SCCP programs. If you look at a product details page at the top of the white window you see lots of editing tools such as text editing for bold, color etc. You should see there also a button that says HTML on it. That's the HTML Tool for where to insert your HTML code if you have any external code or scripts that you need to put on your pages or product details pages.

As for the declaring the head tags, the above info is geared for people that need to add script blocks of some code to the head tags of the page or product details page and you would do this by using the HTML Tool as mentioned above and you would put the code needed within <head>code here</head> tags. This would then tell the page that whatever you put there needs to be added to the head tags of the page.

Hope that helps :)
User 512728 Photo


Registered User
32 posts

[quote=Jo Ann]@Riz: If you enclose something in head tags then it's telling it to put it in the Head of your site rather than the footer.

I understand that but when I view the source code, the code is contained within another set of head tags (not the head tags at the top of the page) Moreover, the code (contained within the second set of head tags) is found within the footer code.

If you have the time, view the source for...

http://www.airconoutlet.com

and do a Ctrl F for "Google" and check out where the code is displayed...within the second set of head tags.

Thank you

Incidentally...Google Analytics appears to be working now. :D
User 38401 Photo


Senior Advisor
10,951 posts

Well the fact that it's in the footer is plainly because you put it in the footer page if I read your other post correctly. Could be that is the only reason it shows up at all is because you included it in a footer area rather than the main page area? Guessing here since I haven't tried it lol.

I don't believe you need to put the Google code in the head at all for that to work. Try putting it in the footer again the same as you were but without the Head tags and see if that fixes it.
User 512728 Photo


Registered User
32 posts

Thanks.

I've tried putting the head tags in the main section as well...does the same thing. It creates a second set of head tags in the middle of the page. In any case, I have my code working so it's not really an issue for me now (Google does advice you to put the code in the header). I am still curious as to why using the header tags in the HTML tool doesn't automatically place the code in the header of the page but I won't be losing any sleep over it. :)

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.