• Login
  • Register

DNN Forums

A community discussion page. We're starting from scratch, so...let's get the party started!

Google Analytics 4

You are not authorized to post a reply.
Sort:


New Member


Posts:15
New Member

    What is the best way to add the new Google Analytics 4 property to a DNN site?

    How do you modify the SiteAnalytics.config file to handle the google tag manager?



    Veteran Member


    Posts:323
    Veteran Member

      Persona bar - Settings - Config manager - Siteanalytics.config
      Tjep's digital agencyRegards,
      Tycho de Waard

      Tjep's digital agency
      We just love DNN
      https://www.tjeps.com


      New Member


      Posts:15
      New Member

        Hi Tycho

        Yes i am aware of where to edit it, but how do i change the existing script to accomodate the new Google analytics ie google the manager

        what script should I use?

        My existing SiteAnalytics.config looks like this:



            
                
                    DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke
                    Head
                    False
                    <ScriptTemplate><br />                          
                        <script type=&quot;text/javascript&quot;><br />                   var _gaq = _gaq || [];
                          _gaq.push(['_setAccount', '[TRACKING_ID]']);
                          _gaq.push(['_trackPageview']);
                     
                          (function() {
                            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                          })();
                        </script>
                
                  ]]>
                    
                

            

        How do I change it to accommodate the Google Tag Manager:

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