Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • valthebault Friend
    #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:

    1. 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.
    2. What has become of my index code? And if I am to add code to it, what should I do?

    1. index
    Phill Moderator
    #870736

    That 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

    valthebault Friend
    #871316

    Thanks, 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


    1. Files
    Phill Moderator
    #871355

    try tpls>blocks>head.php

    valthebault Friend
    #871367

    Hi, 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


    1. GA
    Phill Moderator
    #871404

    Personally 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.

    valthebault Friend
    #871408

    Thanks, Phill, I think I’ll check the excellent JCE out.

    Have a good day 🙂

    valthebault Friend
    #873286

    Hi 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 Moderator
    valthebault Friend
    #873342

    Hi 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


    1. JA
    Phill Moderator
    #873395

    I 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.

    valthebault Friend
    #874384
    This reply has been marked as private.
    Phill Moderator
    #874397

    Good luck with your site.

Viewing 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