-
AuthorPosts
-
petrahk Friend
petrahk
- Join date:
- March 2009
- Posts:
- 145
- Downloads:
- 8
- Uploads:
- 10
- Thanks:
- 38
- Thanked:
- 3 times in 1 posts
January 27, 2011 at 11:55 am #159398Hi, does anybody know, where to put analytics code in this template???
I do not want to use any extension, just paste the code into a file.
Thank you!Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
January 27, 2011 at 12:02 pm #374068Create a custom html module but make sure you use the no editor option or TinyMCE etc will parse your code as text. Put your code in that then place this new module in the debug position.
That should do the trick.
1 user says Thank You to Phill for this useful post
rwjoomlart Friendrwjoomlart
- Join date:
- April 2011
- Posts:
- 44
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
May 13, 2011 at 2:30 pm #391095Can you please explain how to use the no editor option. Cant work out how to do this. Added code via the View HTML source code but it just disappears. (J 1.6)
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
May 13, 2011 at 4:18 pm #391105J1.6 is a complicated beast when it comes to adding code. Even in the “No Editor” mode by default it will strip your code. In this case you need to set text filters to allow it. However, since the above was written Google have changed their preferred method of inserting analytics code. Please follow the instructions below.
Here is the simplest way to add Google or any other analytics/tracking code to this template although there are plugins available on the JED that will aslo do the job if you do not like playing with the code.
Copy the file plugins>system>jat3>jat3>base-themes>default>page>default.php into templates>ja_your-template-name>page>default.php and insert your analytics code just before the </head> tag as per below.
<head>
<?php //gen head base on theme info
$this->showBlock ('head');
?>
<?php
$blocks = T3Common::node_children($this->getBlocksXML ('head'), 'block');
foreach ($blocks as $block) :
$this->showBlock ($block);
endforeach;
?><?php echo $this->showBlock ('css') ?>
************YOUR ANALYTICS CODE HERE*************
</head>1 user says Thank You to Phill for this useful post
rwjoomlart Friendrwjoomlart
- Join date:
- April 2011
- Posts:
- 44
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 13
- Thanked:
- 1 times in 1 posts
May 14, 2011 at 7:36 am #391180Ive copied the default.php and inserted the code into the file but find there is not a “page” folder at templates>ja_events>page>
Please advise.
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
May 14, 2011 at 5:31 pm #391251You simply create the folder yourself and put the file in it. The file in the templates folder then overrides the one in the plugin folder so your changes remain when you update the plugin.
1 user says Thank You to Phill for this useful post
-
AuthorPosts
This topic contains 6 replies, has 3 voices, and was last updated by Phill 13 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum