XF 2.2 Google analytics custom variables?

BIG LLC

Active member
A fair while ago we lost our custom variables for Google Analytics and I cannot for the life of me find out how to re-add them.

I know where to add the property ID, it's all running fine on that front.

We used to have some good custom reports to track visits by forum ID and so on and I want to bring them back.

Can anyone point me in the right direction?

I can see in the page source where they should go but not in the Admin CP. Would we need to modify core templates?
 

BIG LLC

Active member
Found the google analytics template easily enough:

HTML:
<xf:if is="$xf.options.googleAnalyticsWebPropertyId">
    <script async src="https://www.googletagmanager.com/gtag/js?id={$xf.options.googleAnalyticsWebPropertyId}"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', '{$xf.options.googleAnalyticsWebPropertyId|escape("js")}', {
            // <!--[XF:ga:config_start]-->
            <xf:if is="$xf.cookie.domain">
                'cookie_domain': '{$xf.cookie.domain}',
            </xf:if>
            <xf:if is="$xf.options.googleAnalyticsAnonymize">
                'anonymize_ip': true,
            </xf:if>
        });
    </script>
</xf:if>

Are there any existing addons or ways to add in our custom variables like ForumID?
 
Top