-
AuthorPosts
-
April 15, 2010 at 4:47 pm #150393
hi Joomlart-Friends,
i’m new in the world of Joomart. Can anyone tell me how i can insert the google-code’s (googleanalytics and so well ) between head and body-tag??
i try it in template html, but it isn’t works.
thanks for the good support.
Markus from projekt.ofranet.sorry for my bad english
beastmode54 JA JobBoardbeastmode54
- Join date:
- November 2007
- Posts:
- 233
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 12
- Thanked:
- 20 times in 1 posts
cansay Friendcansay
- Join date:
- February 2010
- Posts:
- 183
- Downloads:
- 2
- Uploads:
- 32
- Thanks:
- 20
- Thanked:
- 19 times in 1 posts
April 15, 2010 at 10:10 pm #340499<em>@ofranet 174731 wrote:</em><blockquote>hi Joomlart-Friends,
i’m new in the world of Joomart. Can anyone tell me how i can insert the google-code’s (googleanalytics and so well ) between head and body-tag??
i try it in template html, but it isn’t works.
thanks for the good support.
Markus from projekt.ofranet.sorry for my bad english</blockquote>
you must insert it via FTP 🙂
Go to “/templates/ja_ores/layouts/”
There will be 3 files.
Default.php
Hanheld.php
Iphone.phpAll 3 files need the code, that way you can track iphones and so on also 🙂
Open the file and browse to the buttom of the file default.php
after the php endif; ? > inset you google code.Then save.
Then test website still works fine.
Then validate that the tracking works from your google analytics/webmaster account[PHP]<?php if ($this->isIE6()) : ?>
<?php $this->loadBlock(‘ie6/ie6warning’) ?>
<?php endif; ?><script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
try {
var pageTracker = _gat._getTracker(“UA-XXXXXXXX-X”);
pageTracker._trackPageview();
} catch(err) {}</script>
</body></html>[/PHP]
3 users say Thank You to cansay for this useful post
damian Frienddamian
- Join date:
- May 2008
- Posts:
- 154
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 70
- Thanked:
- 20 times in 1 posts
April 15, 2010 at 11:25 pm #340506i’m use this plugin : http://extensions.joomla.org/extensions/site-management/site-analytics/11594 for all my site. just one minute install
June 28, 2011 at 2:28 pm #398881<em>@cansay 174752 wrote:</em><blockquote>you must insert it via FTP 🙂
Go to “/templates/ja_ores/layouts/”
There will be 3 files.
Default.php
Hanheld.php
Iphone.phpAll 3 files need the code, that way you can track iphones and so on also 🙂
Open the file and browse to the buttom of the file default.php
after the php endif; ? > inset you google code.Then save.
Then test website still works fine.
Then validate that the tracking works from your google analytics/webmaster account[PHP]<?php if ($this->isIE6()) : ?>
<?php $this->loadBlock(‘ie6/ie6warning’) ?>
<?php endif; ?><script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
try {
var pageTracker = _gat._getTracker(“UA-XXXXXXXX-X”);
pageTracker._trackPageview();
} catch(err) {}</script>
</body></html>[/PHP]</blockquote>
I see a lot of people referring to “/templates/ja_ores/layouts/” but I don’t see the layouts directory. I am using my cpanel file explorer. Is it only visible via FTP?
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
June 28, 2011 at 3:10 pm #398891<em>@raredesign 250223 wrote:</em><blockquote>I see a lot of people referring to “/templates/ja_ores/layouts/” but I don’t see the layouts directory. I am using my cpanel file explorer. Is it only visible via FTP?</blockquote>
I personally would always use ftp as it is a lot more reliable.
First we need to copy a file from the plugins folder to the templates folder so copy
plugins>system>jat3>jat3>base-themes>default>blocks>head.php and copy it to
templates>ja_yourt3basedtemplatename>blocks>head.php
The new file will take precedence over the one in the plugin
In that you will see the following code, place your analytics code right at the bottom
<?php
/*
# ------------------------------------------------------------------------
# JA T3 System plugin for Joomla 1.6
# ------------------------------------------------------------------------
# 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.
# ------------------------------------------------------------------------
*/
?>
<script type="text/javascript">
var siteurl='<?php echo JURI::base(true) ?>/';
var tmplurl='<?php echo JURI::base(true)."/templates/".T3_ACTIVE_TEMPLATE ?>/';
var isRTL = <?php echo $this->isRTL()?'true':'false' ?>;
</script><jdoc:include type="head" />
<?php if (T3Common::mobile_device_detect()=='iphone'):?>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1; user-scalable=1;" />
<meta name="apple-touch-fullscreen" content="YES" />
<?php endif;?>
<?php if (T3Common::mobile_device_detect()):?>
<meta name="HandheldFriendly" content="true" />
<?php endif;?>
<link href="<?php echo T3Path::getUrl('images/favicon.ico') ?>" rel="shortcut icon" type="image/x-icon" />
<?php JHTML::stylesheet ('', 'templates/system/css/system.css') ?>
<?php JHTML::stylesheet ('', 'templates/system/css/general.css') ?>
<!-->
<style>
.clearfix { display: inline-block; } /* IE7xhtml*/
</style>
<!-->
Depending on your template this may not put it right before the </head> tag but it will put it very close. It all depends on what other extensions are loaded into Joomla which may load some of their own scripts after this.
-
AuthorPosts
This topic contains 6 replies, has 6 voices, and was last updated by Phill 13 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum