I am currently using CE4 Pages, CE4 Gallery and CE4 AutoIndex and would like to know where and what file I need to edit to input the Google Analytics code as I still cannot find the right file to edit. I have search the forum and I am aware of the link: http://ce4.theturninggate.net/docs/doku … _analytics but would prefer to just edit the file directly but I seem to be editing the wrong files.
These are the files I have tried to input the code:
1. CE4Pages\phplugins -> index.html : No Luck
2. CE4Pages -> template_cart.php, template_index.php, template_mobile.php and template_single.php : No Luck
(I have placed the code right below <!DOCTYPE html> and before <head> in the attempts above)
Can someone tell me what file I need to edit and the location of it.
If you don't want to use the built-in feature that inserts your Google ID into the Analytics script, you could use phplugins and insert the script using the ttg_head_end hook
http://ce4.theturninggate.net/docs/doku … _phplugins
If you still want to edit the files directly, open your export public facing .php and .html page files and place the entire Google Analytics script somewhere before the end of the closing head tag.
(you'll have to get it from Google since the script isn't included unless you've added an ID to the Google Analytics field in Site Info)
For Pages that would be: index.php, mobile.php, contact.php, galleries.php, info.php, services.php, about.php
You'll need to do this for all pages, galleries, autoindexes. If using Publisher, edit the template_xxx.php files for autoindex and gallery.
Can I ask why you don't want to simply add your Google Analytics ID in the plug-in?
Thank you for the reply. The only reason I didn't want to use the interface plug-in is that it takes long to load and export, therefore I thought it would be quicker just editing the .html or.php file and just uploading those. If this doesn't work then I will just take your suggestion and insert using the plug-in option.
Depending on your setup (whether or not you're using Publisher) editing the files could take a whole lot longer.. And if you are using Publisher, then just changing templates, exporting and uploading those would be much faster.
Plus, you don't have to upload the entire export, just the index.php files for AutoIndexes and galleries and the template_xxx.php files for templates.