Reputation: 3436
I'm implementing Google Analytics into my website that is made on top of Joomla CMS.
In current step I need to insert the JavaScript code snippet in every page file on the site I want to track.
I guess I need to put the code only in one file somewhere inside of Joomla file hierarchy to avoid putting it on every possible html file. Do you think this is the correct approach ?
Any suggestions where this code should be placed?
Upvotes: 2
Views: 1084
Reputation: 3464
You could use this plugin. Just install it and in backend copy the analytics code into it.
The another possibility is to insert the code into template index file.
But, as rightly pointed out by Lodder, please be aware, that, after template update, this code will be probably deleted.
In backend simply go to extensions->template manager, click on the template you are using on the site, and click on Edit main page template
link and just insert it into the <head>
section.
You can also do it manually, open file in /templates/name_of_your_template/index.php and do the same as above.
Upvotes: 4