Question: AFAIK, DotNetNuke websites automatically generate your Google Analytics tracking code. 

Recently Google has suggested changing the tracking code you need to use ([to this](https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad)) if you wish to use new features such as demographics. Any idea how to customise the GA code generated by DotNetNuke? 

I've looked into the DNN database and the GA code or UA don't seen to exist there. Also checked the language editor without luck.

Answer: 
Editing SiteAnalytics.config in the website root (httpdocs) seems to be the correct solution.

The GA code in /Config/SiteAnalytics.config doesn't affect what is rendered in the page. As Chris mentions below, this might be what is generated for each new portal.
Please note that i am using DNN 7

WHat version are you using?

Here is all of what is in my root SiteAnalytics.config file:

```
<?xml version="1.0" encoding="utf-8" ?>
<AnalyticsEngineConfig>
    <Engines>
        <AnalyticsEngine>
            <EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
            <ElementId>Head</ElementId>
            <InjectTop>False</InjectTop>
            <ScriptTemplate>
                <![CDATA[     

                <script type="text/javascript">

                      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

                      ga('create', '[TRACKING_ID]');
                      ga('send', 'pageview');

                </script>

          ]]>
            </ScriptTemplate>
        </AnalyticsEngine>
    </Engines>
</AnalyticsEngineConfig>

```

Paste that and upload to your ftp. Make sure the site you are testing has a google tracking ID set in the google analytics setting for the site otherwise this code will not show up.