We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10504
    • 2 Posts
    Hello, Im new to MODx for forgive me if this is a school boy error.

    I have some javascript i need to put into a page, its the google anayltics code. When I click save, it wont save the page. I dont get any errors, if I take out the <script> tags it will save ok.

    Is there any reason why MODx could be blocking the script tags?

    Hope some one can help.

    Many Thanks
    Gary Ian Ward
      • 15083
      • 697 Posts
      Hi and welcome to MODx smiley

      Firstly this is the wrong board for General support, post there is future.

      Regarding your problem, add you GA JavaScript code to your template, that way whenever u create a new page it is automatically tracked by Google Analytics. Put the code before your closing </body> tag in the template.

      If you must add it to just one page, click page settings and turn the "Rich Text" off. You will now get a plain text field rather than an editor that will take whatever you throw at it!

      Good luck!