• Login
  • Register

DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Google Analytics - No Results

You are not authorized to post a reply.

New Member

New Member

    (Repost from FB DNN Connect Group) I have 2 portals on one 9.3.2 instance. Google analytics works in one (Portal 0) and not in the other (Portal 1). Confirmed the settings are identical in both portals (different tracking#), send test data from Analytics properly 'finds' the site (Portal 1). Any thoughts or recommendations would be much appreciated! Thanks!
    Additional Info:
    * Analytics Code on both sites is correct, and confirmed to match the Google Script. Tracking numbers are the only difference.
    * Both are SSL secured, site maps are correct.
    * DIFFERENCE- Important? -- One thing I just discovered that is different between the two - not sure of the significance (old sites) -- the working site has this code snippet in the Head section, starting at line 6. It is absent from the non-working site (UA id replaced with X's)

    <!-- Global site tag (gtag.js) - Google Analytics -->

    <script async src=&quot;<a href="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX&amp;fbclid=IwAR3qe3ldNLES4DpbDfAr5OyxuXu1wRI-wBR_CMlJ9hbLd1DZ99lLFbhfEIg" rel="nofollow" role="link" tabindex="0" target="_blank">https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX</a>&quot;></script></p>


    New Member

    New Member

      FWIW, this is my SiteAnalyticsConfig file:

                  DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke
                  <ScriptTemplate> <br />                 <![CDATA[      <br /> <br />                 <script type="text/javascript"> <br /> <br />                       (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ <br />                       (i[r].q=i[r].q||).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), <br />                       m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) <br />                       })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); <br /> <br />                       ga('create', '[TRACKING_ID]'); <br />                       ga('send', 'pageview'); <br /> <br />                 </script> <br />            ]]> <br />             </ScriptTemplate> <br />         </AnalyticsEngine> <br />     </Engines></AnalyticsEngineConfig>

      Veteran Member

      Veteran Member

        Do you see JS errors in the browser console? (F12)

        New Member

        New Member

          Yes, one.
          11 Uncaught SyntaxError: Unexpected token ')'

          However, this same error also appears on the working site, albeit on a different line (21), and both are in the Google code.

          <script type="text/javascript"> <br /> <br /> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ <br /> This line:-----> (i[r].q=i[r].q||).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), <br /> m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) <br /> })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); <br /> <br /> ga('create', 'UA-XXXXXXXX'); <br /> ga('send', 'pageview'); <br /> <br /> </script> <br /> Thank you! <br />

          New Member

          New Member

            I figured it out. The google analytics connector was correctly configured in both sites, however....as I mentioned they are old sites, and previously had embedded the 'original' Google supplied code into the Site Settings/Site Behavior Page Output Settings -- on the working site 0 only. The other site - site 1 - not working only had the analytics connector, not the 'original' code from google. So, apparently the combo of DNN/Google somehow disallowed the connection with just the analytics connector on site 1. Once I pasted the 'original' google code into the page output settings, it began working immediately. To confirm, I stripped out the 'original' code from both sites, just leaving the Analytics Connecter, and the connection to google stopped. Once I pasted the 'original' code into the Page Output Settings on BOTH sites, it started working again. So, in short, it seems like there may be a bug with multi-portal sites with the Google Analytics connector. Other single site properties with just the Analytics Connector work great.

            Thank you to everyone for your help!
            You are not authorized to post a reply.

            These Forums are dedicated to discussion of DNN Platform.

            For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

            1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
            2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
            3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
            4. No Flaming or Trolling.
            5. No Profanity, Racism, or Prejudice.
            6. Site Moderators have the final word on approving / removing a thread or post or comment.
            7. English language posting only, please.

            Would you like to help us?

            Awesome! Simply post in the forums using the link below and we'll get you started.

            Get Involved