Implementing Code on every page of site?

Started by ivanTW, September 02, 2014, 09:16:02 PM

Previous topic - Next topic

ivanTW

Hi,

I'm implementing Google Tag Manager across my site, and one of the instructions is to paste the code on every page of the site. Which .php page will accomplish this? would it be index.template.php? Not quite sure so I figured I would ask. I assume there's one php page I can paste it to above the <body> tag that will dynamically paste it across the site...maybe I'm wrong? I don't know.

Thanks for any help.

mashby

Themes/THEMENAMEHERE/index.template.php
How many themes do you have on your site? Add your code to each theme's index.template.php file. And of course, do be mindful that you will be editing PHP files which takes a little bit of care in doing so. Be mindful of the ' characters if such things are in the code you need to include.
Always be a little kinder than necessary.
- James M. Barrie

ivanTW

Many Thanks!

I have two themes NOVO and the default. If I'm using NOVO that's the only one I need to paste it in correct?

Yes. I had one instance where I forgot to escape all the ' with / and I got scared for a minute, but at least I know what the problem is if that happens and of course I always create a copy before editing anyway.  :)

mashby

If you don't allow your users to switch to the default one, the NOVO one should do it, but it wouldn't hurt to do the default one (any admin can use it), but consider that extra credit. :)
Always be a little kinder than necessary.
- James M. Barrie

ivanTW

Awesome! Thanks again for the help and the quick responses.

mashby

No problem. :) Hope you get your code in place safely enough.  8)
Always be a little kinder than necessary.
- James M. Barrie

Advertisement: