DNN Forums

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

Google Analytics 4

Sort:
You are not authorized to post a reply.





New Around Here





    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





      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 Around Here





        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 -->