-
AuthorPosts
-
January 28, 2016 at 2:34 pm #870657
Hi,
I currently need to add a few lines of code on my template sugite, only to find that the index.php file is practically empty, I took a screen shot of the existing code and I wander:
- Where has my Google Analytics code gone? I understand it has to be marked here but it’s gone. Yet I keep receiving google analytics results.
- What has become of my index code? And if I am to add code to it, what should I do?
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
January 28, 2016 at 4:30 pm #870736That is normal. All the index.php does in T3 is load the layout blocks. Your GA code could be placed in one of a couple of places in those blocks. There are plenty of posts detailing exactly how and where you can do that. In the latest version of the T3 system you can add GA code in the Joomla back end making life even easier
January 29, 2016 at 8:57 am #871316Thanks, I’ll be looking for that.
The problem is, my director (who put the GA code somewhere himself) couldn’t find the code anymore and this puts us in doubt of our statistics.
And, now I have to add a few lines of javascripts aiming some articles but not all, where could I specifically add these scripts to chosen articles? Like in which file?
I put a screen shot of what files I have and I’d very much appreciated it if you could point me to the right direction.
Thanks
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
January 29, 2016 at 9:41 am #871355try tpls>blocks>head.php
January 29, 2016 at 9:52 am #871367Hi, thanks for the answer.
I found this line thanks to your direction, and I think that’s where I’d put the GA code.
Should I also put hte javascripts for certain articles here too?
How should I twist it so that it fits well? As in where to put the script (before or after the GA code) or add a few lines indicating the title of the article?Again, thanks
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
January 29, 2016 at 10:24 am #871404Personally if I were putting JS in individual articles I would do that directly in each article. To do it you need to turn off the editor and make a couple of changes in the Joomla setup. Alternatively, there are plugins available on the JED that allow you to easily insert JS into individual articles. IIRC, the excellent JCE also has an option to insert JS in individual articles.
Doing it in the head of the site can be done with a bit of effort but it increases the load on all pages. In addition, it is complicated requiring far more maintenance.
January 29, 2016 at 10:36 am #871408Thanks, Phill, I think I’ll check the excellent JCE out.
Have a good day 🙂
February 1, 2016 at 9:18 am #873286Hi Phil,
I took your advice and installed JCE Editor. However, when I’ve done pasting the script to an article and have clicked ‘save’, the script is gone. Is it normal?
For your information, the script is for that we could supervise visiting frequency on certain articles, so the content of the javascript is not supposed to appear on the article.
How should I know that the script is well pasted?
Thanks in advance
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
February 1, 2016 at 9:54 am #873329February 1, 2016 at 10:04 am #873342Hi Phil,
Actually before I came post the question I did everything recommanded on that article. Thanks for it anyways.
Other explanation? Like How am I to know that the script is well added? Or it’s only done when it’s not deleted afterwards.
However, I didn’t have ‘Allow JA Script’ I have ‘Compress Options’ like shown in the image below. I tried both yes and no to ‘Compress Javascript’ and it changes nothing.
Thanks in advance
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
February 1, 2016 at 10:53 am #873395I think you are looking in the wrong place for the settings mentioned in that article.
If you would like us to take a look, use the "Set as Private Reply" option to send us login details along with a link to both your admin and to an article where you would like js placed.
February 2, 2016 at 2:25 pm #874384This reply has been marked as private.Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
February 2, 2016 at 2:49 pm #874397Good luck with your site.
AuthorPostsViewing 13 posts - 1 through 13 (of 13 total)This topic contains 12 replies, has 2 voices, and was last updated by Phill 8 years, 9 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum