0
Welcome Guest! Login
0 items Join Now

SOLVED jquery code visible after entering Analytics code in Atom

  • SOLVED jquery code visible after entering Analytics code in Atom

    Posted 6 years 11 months ago
    • I am using the Gemini template with Joomla 3.8.7 on a PHP 5.6 shared server.

      After I launched the site, I entered the Google Analytics code in the atoim for "Base Outline" by creating a new JS entry.
      I realize that was stupid since there is a Analytics Atom just for that, but I was handling an emergency at the same time and I screwed up.

      The real problem is that now the entry I made in the Atom is gone, the analytics code is indeed visible in the page code, but at the very top of every page I am also seeing the code for jQuery in plain text.
      You can see it here (unless I manage to fix it): jlsinc.com

      My bnest guess is that the template (or Gantry 5 more specifically) incorporated the Google analytics code (and its HTML comments) in some of the template files, broke the jQuery code that now displays in plain text above the header of every page.

      What can I do to fix this? I tried looking for the code but I cannot find it (so far) and I am at a loss.

      I am having other issues with Gantry as well that I cannot explain, but this is my most pressing one.

      Can anyone help?

      Thank you.
    • Last Edit: 6 years 11 months ago by Marco Conti.
  • Re: SOLVED jquery code visible after entering Analytics code in Atom

    Posted 6 years 11 months ago
    • Well, I answered my own question: the change was done on this file:

      templates\rt_gemini\custom\config\default\page\head.yaml

      and looked something like this at line 13:


              - { location: '', inline: "<!-- Global site tag (gtag.js) - Google Analytics -->\n<script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxxxx-1\"></script>\n<script>\n  window.dataLayer = window.dataLayer || [];\n  function gtag(){dataLayer.push(arguments);}\n  gtag('js', new Date());\n\n  gtag('config', 'UA-xxxxxxxxxx-1');\n</script>", in_footer: '0', extra: {  }, priority: '0', name: 'google analytics' }




      I deleted the code and now the site is back to working fine. Just in case anyone does the same idiotic thing, this is how you fix it (for the record, I did a global serch for "Google Analytics -->". Unfortunately, I use Dreamweaver and it is notoriously bad at sesarching inside files that are not PHP, HTML etc. There is a workaround but given the page of updates DW goes through it is no longer feasible to fix it.
      I used notepad++ to find the offending code.

Time to create page: 0.061 seconds