Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-02-22 08:01:57

prchevalier
Member
Registered: 2016-04-19
Posts: 21

Google Analytics

Hello,

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.

Many Thanks,
Phill

Offline

#2 2017-02-22 08:55:12

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Google Analytics

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?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2017-02-22 13:51:35

prchevalier
Member
Registered: 2016-04-19
Posts: 21

Re: Google Analytics

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.

Offline

#4 2017-02-22 13:57:20

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Google Analytics

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.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

Board footer

Powered by FluxBB