Skip to main content
Known Participant
March 3, 2023
Question

Google Tag Manager Installation

  • March 3, 2023
  • 3 replies
  • 574 views

Good morning. I am trying to install the script for Google Tag Manager as per their instructions into the Master Page for my Robohelp Version 2020.8.34 project. As per attachment, I'm getting an "Invalid character =" error.  Would appreciate any assistance.


    This topic has been closed for replies.

    3 replies

    davidk99046111
    Inspiring
    March 8, 2023

    easiest thing to do is make it a separate js file and call it in the master page as script.  Eliminates fighting with adobe's editor.  That is what I do for analytics and tag manager on my site.  For the analytics tracking code update the async line to async="".  Calling it in as a separate script is much easier.  Plus, if you are using a staging server to test before pushing to production, tag manager and analytics won't capture the test data as you just have to switch out the js files.  

    Community Expert
    March 5, 2023

    Do you have a developer who might be able to help? Otherwise I think you'll need to contact Adobe to find out what their code checker is expecting.

     

    See the following page for support contact options. The email address is recommended as it goes to a dedicated Robohelp team.
    https://helpx.adobe.com/contact/enterprise-support.other.html#robohelp

    Known Participant
    March 3, 2023

    If I click to Autofix, it appears as below, but still doesn't work:
    <!-- Google Tag Manager -->
    <script>
    //<![CDATA[
    (function(w, d, s, l, i) {
    w[l] = w[l] || [];
    w[l].push({
    'gtm.start': new Date().getTime(),
    event: 'gtm.js'
    });
    var f = d.getElementsByTagName(s)[0],
    j = d.createElement(s),
    dl = l != 'dataLayer' ? '&l=' + l : '';
    j.async = true;
    j.src=
    'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
    f.parentNode.insertBefore(j, f);
    })(window, document, 'script', 'dataLayer', 'GTM-XXXXXXX');
    //]]>
    </script>
    <!-- End Google Tag Manager -->
    </head>
    <body>
    <!-- Google Tag Manager (noscript) --><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><!-- End Google Tag Manager (noscript) -->
    <div data-region="header">