-
AuthorPosts
-
October 26, 2009 at 2:51 pm #145500
I tried to insert the google analytics script into the html page but could not find where the body section is. Google wants the script to be inserted right before the body.
Thanks,
Jimmy
mihirc Friendmihirc
- Join date:
- December 2008
- Posts:
- 597
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 62
- Thanked:
- 95 times in 39 posts
October 26, 2009 at 3:03 pm #321608Hello,
You would need to install this by doing a very simple modification to the Joomlart template.
Go to templates/ja_halite/ and use a Code editor, like notepad, or dreamweaver to open the index.php file.
Scroll to the bottom to where the </body> tag is. Put the javascript codes that Google Analytics gives and insert it before the tag. Save the file and upload it. It normally takes around 12 – 24 hours for it to get verified.
Regards,
Mihir Chhatre.1 user says Thank You to mihirc for this useful post
October 26, 2009 at 3:34 pm #321610My index.php does not have a body tag anywhere in it, that is what threw me off originally. Here is the code (I installed using the quickstart option by the way)-
<?php
/**
* @copyright Copyright (C) 2005 – 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/// no direct access
defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );include_once (dirname(__FILE__).DS.’libs’.DS.’ja.template.helper.php’);
if (defined(‘_DEMO_MODE_’)) $tmplTools = JATemplateHelper::getInstance($this, array(JA_TOOL_MENU, JA_TOOL_COLOR,’ui’));
else $tmplTools = JATemplateHelper::getInstance($this, array(‘ui’));
# Auto Collapse Divs Functions ##########
$ja_left = $this->countModules(‘left’) || ($tmplTools->getParam(JA_TOOL_MENU) == 1);
$ja_right = $this->countModules(‘right’);if ( $ja_left && $ja_right ) {
$divid = ”;
} elseif ( $ja_left ) {
$divid = ‘-fr’;
} elseif ( $ja_right ) {
$divid = ‘-fl’;
} else {
$divid = ‘-f’;
}
$tmplTools->setParam (‘divid’, $divid);$curidx = $tmplTools->getCurrentMenuIndex();
//if ($curidx) $curidx–;//Calculate the width of template
$tmplWidth = ”;
$tmplWrapMin = ‘100%’;
switch ($tmplTools->getParam(JA_TOOL_SCREEN)){
case ‘auto’:
$tmplWidth = ‘97%’;
break;
case ‘fluid’:
$tmplWidth = intval($tmplTools->getParam(‘ja_screen_width’));
$tmplWidth = $tmplWidth ? $tmplWidth.’%’ : ‘90%’;
break;
case ‘fix’:
$tmplWidth = intval($tmplTools->getParam(‘ja_screen_width’));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).’px’ : ‘751px’;
$tmplWidth = $tmplWidth ? $tmplWidth.’px’ : ‘750px’;
break;
default:
$tmplWidth = intval($tmplTools->getParam(JA_TOOL_SCREEN));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).’px’ : ‘751px’;
$tmplWidth = $tmplWidth ? $tmplWidth.’px’ : ‘750px’;
break;
}$tmplTools->setParam (‘tmplWidth’, $tmplWidth);
$tmplTools->setParam (‘tmplWrapMin’, $tmplWrapMin);//Main navigation
$ja_menutype = $tmplTools->getParam(JA_TOOL_MENU, ‘css’);
$jamenu = null;
if ($ja_menutype && $ja_menutype != ‘none’) {
$japarams = new JParameter(”);
$japarams->set( ‘menutype’, $tmplTools->getParam(‘menutype’, ‘mainmenu’) );
$japarams->set( ‘menu_images_align’, ‘left’ );
$japarams->set( ‘menupath’, $tmplTools->templateurl() .’/ja_menus’);
$japarams->set(‘menu_title’, 0);
$japarams->set(‘menu_images’, 1);$tmplTools->loadMenu($japarams);
}//End for main navigation
$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout);
}Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
October 27, 2009 at 3:41 am #321685Hi jewellman
Open templatesja_halitelayouts folder, find your layout file to open. You can find </body> tag in each file to add your script.
October 27, 2009 at 12:14 pm #321760Thanks!
Jimmy
bryantwest Friendbryantwest
- Join date:
- March 2009
- Posts:
- 52
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 4 times in 1 posts
November 25, 2009 at 7:35 am #324893I’m no expert, but I highly recommend BIGSHOT Google Analytics (http://extensions.joomla.org/extensions/site-management/site-analytics/6170). Just install, go to pluggins, turn it on and enter your Google Analytics code… and hey presto.
I have it running on about 10 sites, works a treat.
1 user says Thank You to bryantwest for this useful post
thatch10 Friendthatch10
- Join date:
- May 2008
- Posts:
- 104
- Downloads:
- 154
- Uploads:
- 8
- Thanks:
- 11
- Thanked:
- 19 times in 1 posts
November 27, 2009 at 2:33 pm #325141Just to add annother option to the field.
JoomlaGATor! allows Under user defined tracking so you can see whoo is logging on to use your site
http://extensions.joomla.org/extensions/site-management/site-analytics/3356its not a plugin as BIGSHOT Google Analytics is, its a module.
You take your pick
Thatch
-
AuthorPosts
This topic contains 7 replies, has 5 voices, and was last updated by thatch10 14 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum