-
AuthorPosts
-
March 22, 2010 at 4:33 am #149705
hi ,
I would like to know how to add code google anaytics on ja_seleni template ,
knowing that there is note a balise <body> in index.phpthnxx
March 22, 2010 at 5:27 am #337149I don’t think it’s necessary to have it in a specific place in the HTML, have you tried just putting it in at the bottom?
The reason they tell you to put it at the very bottom right before the end body tag is so that it doesn’t delay the loading of the rest of the page. If it’s next to stuff that gets rendered, that stuff is going to be within the body tag.
March 22, 2010 at 7:43 am #337180To add Analytics code to any Joomla template, simply edit the html of the template file and paste your analytics code imediately before the closing </body> tag at the bottom of the code.
You can edit the template html file directly through the administrator panel.
Click on Extensions -> Template Mangager
Select the Template you want to add the code to and click Edit in the top right
Select Edit HTML
Paste the code above the </body> tag
Click OK
Visit your site
Wait 30 mins
Check your google analytics account.
😀James Weston FriendJames Weston
- Join date:
- September 2014
- Posts:
- 1030
- Downloads:
- 11
- Uploads:
- 70
- Thanks:
- 408
- Thanked:
- 16 times in 1 posts
April 6, 2010 at 8:51 am #339275<em>@yoda123 170642 wrote:</em><blockquote>To add Analytics code to any Joomla template, simply edit the html of the template file and paste your analytics code imediately before the closing </body> tag at the bottom of the code.
You can edit the template html file directly through the administrator panel.
Click on Extensions -> Template Mangager
Select the Template you want to add the code to and click Edit in the top right
Select Edit HTML
Paste the code above the </body> tag
Click OK
Visit your site
Wait 30 mins
Check your google analytics account.
:D</blockquote>
Hi I just tried following your instructions on the JA Teline III template. However, when i go to edit HTML there is no </body> tag:<?php
/*
# ————————————————————————
# JA Teline III – Stable – Version 1.4 – Licence Owner JA179264
# ————————————————————————
# Copyright (C) 2004-2009 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license – Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites: http://www.joomlart.com – http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
# ————————————————————————
*/// no direct access
defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );include_once (dirname(__FILE__).DS.’libs’.DS.’ja.template.helper.php’);
$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->getMenuType();
$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);$jamenu = $tmplTools->loadMenu($japarams, $ja_menutype);
}//End for main navigation
$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout);
}Any ideas?
anatta Friendanatta
- Join date:
- May 2008
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 2 times in 1 posts
April 6, 2010 at 4:12 pm #339332I think that you just have the top part of the code. Try scrolling down further (there should be a scrollbar within the window) – the code should end with “?>” and you should find the </body> tag a couple of lines above that.
April 11, 2010 at 9:13 pm #339949And for those templates like this one that haven’t got body tag in their index.php file or Template edit html file???????
how can we add analytics to that one???
cansay Friendcansay
- Join date:
- February 2010
- Posts:
- 183
- Downloads:
- 2
- Uploads:
- 32
- Thanks:
- 20
- Thanked:
- 19 times in 1 posts
April 11, 2010 at 9:19 pm #339950<em>@projekt 174087 wrote:</em><blockquote>And for those templates like this one that haven’t got body tag in their index.php file or Template edit html file???????
how can we add analytics to that one???</blockquote>
They do have this m8 🙂
Just use FTP to or eXtplorer to view the template 🙂
anatta Friendanatta
- Join date:
- May 2008
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 2 times in 1 posts
April 12, 2010 at 2:00 am #339968Difficult to say without seeing the code. It is possible that your theme calls a different module like the footer that closes the body and html tags, although personally, I haven’t ever seen this myself.
If you can PM me the template I could probably help you find it, but I agree with cansay that you’re probably just not seeing it.
I will need to see the file /templates/your_theme/index.php
April 12, 2010 at 7:10 pm #340125Thanks for the info, I’m new to Joomla.
I’ve build many sites on the wordpress platform and am trying to branch out. Joomla seems a bit more technical but this is an awesome site to learn from.
Brian
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
April 13, 2010 at 9:54 am #340218Dear all !
the best way is here , you should create a custom module and put the google code into the content of the module, and put this module on the footnav position, you should not put google code into the php file because, it will influence to the template upgrading.
GOod luck
April 23, 2010 at 6:22 am #341300I think you can add the code:
1, Use a plugin, this way you can simply enter your GA number, sth like UA-xxxxxxx-x. You can find this plugin here http://extensions.joomla.org/extensions/site-management/site-analytics/4300
2, Just go to your template on the danshboard, try to edit your html code, and add your GA code at the BOTTOM. Note, always insert the JS script at the bottom as it slows you down.
Hope this helps.:D
April 24, 2010 at 5:51 am #341399Good Suggestion.
thanksDecember 29, 2010 at 8:13 am #369097Thanks for your info. Could you recommend one of the best custom module?
Cheers!
<em>@tienhc 174401 wrote:</em><blockquote>Dear all !
the best way is here , you should create a custom module and put the google code into the content of the module, and put this module on the footnav position, you should not put google code into the php file because, it will influence to the template upgrading.
GOod luck</blockquote>
fordangelina40 Friendfordangelina40
- Join date:
- December 2010
- Posts:
- 4
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 1 times in 2 posts
December 29, 2010 at 6:44 pm #369198Thanks for the info, I’m new to Joomla.
I think you can add the code:1, Use a plugin, this way you can simply enter your GA number, sth like UA-xxxxxxx-x. You can find this plugin here http://extensions.joomla.org/extensi...analytics/4300
2, Just go to your template on the danshboard, try to edit your html code, and add your GA code at the BOTTOM. Note, always insert the JS script at the bottom as it slows you down.
fordangelina40 Friendfordangelina40
- Join date:
- December 2010
- Posts:
- 4
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 1 times in 2 posts
December 29, 2010 at 6:45 pm #369199<em>@wlanguide 175757 wrote:</em><blockquote>I think you can add the code:
1, Use a plugin, this way you can simply enter your GA number, sth like UA-xxxxxxx-x. You can find this plugin here http://extensions.joomla.org/extensions/site-management/site-analytics/4300
2, Just go to your template on the danshboard, try to edit your html code, and add your GA code at the BOTTOM. Note, always insert the JS script at the bottom as it slows you down.
Hope this helps.:D</blockquote>
You are the best.
-
AuthorPosts
This topic contains 18 replies, has 16 voices, and was last updated by r90sfan 13 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum