Google Analytics + TYPO3 CMS (Complete Tutorial)

Google Analytics + TYPO3 CMS (Complete Tutorial)

Do you want to integrate Google Analytics code at your TYPO3 website? This article will find simple to advanced level Google Analytics integration into TYPO3 CMS - with and without TYPO3 extensions. Keep reading!

Google Analytics is one of the most popular and loved for website owners and marketers. Even after GDPR, the popularity of Google Analytics does not have any effect. TYPO3 CMS is very flexible to integrate third-party tools easily.  Let’s figure out what/why/how about Google Analytics and TYPO3.

“If you can’t measure it, you can’t improve it.”

10 Reasons your site need to have Google Analytics

The goal is to turn data into information, information into insight.

  • it's far free
  • automatically collects data
  • custom-designed reports
  • integration with different tools and systems
  • ability to measure internal site search under behaviour
  • to apprehend why traffic is bouncing off your internet site
  • to recognise the age, gender, interest, tool, and vicinity of your audience
  • to apprehend which social systems to target
  • to know what type of content material you need to write
  • to test in case, you are attaining goals

The New Google Analytics 4

You know the old saying “If you can’t measure it, you can’t improve it” by Peter Drucker. Well, Google has improved their Analytics tool to help us measure how users interact with our business even more.

Where To Get Google Analytics Code?

To find the Google tracking ID and code snippet:

  • Sign in to your Analytics account.
  • Click Admin.
  • Select an account from the menu in the ACCOUNT column.
  • Select a property from the menu in the PROPERTY column.
  • Under PROPERTY, click Tracking Info > Tracking Code.

Google Analytics in TYPO3 (without Extensions)

To add Google Analytics in TYPO3, you do not require any particular extension or plugin. TYPO3 is awesome to integrate such third-party tools; Follow the steps to integrate Google Analytics into TYPO3 CMS.

Step 1. Login to your TYPO3 backend.

Step 2. Go to Web > Template module from the left sidebar.

Step 3. Click on your root/main page.

Step 4. Click on the “Edit Template” button.

Step 5. In the “Setup” editor, Add your Google Analytics code with the following TypoScript.

 

// TYPO3 TypoScript Code for Google Analytics
// Add your GA <script> code to below TypoScript code
page {
    headerData {
        999 = TEXT
        999.value (
            <!-- Google Analytics -->
                <script type=”text/javascript”>
                </script>
            <!-- Google Analytics End -->
        )
    }
}

 

Step 6. Done! (Don’t forget to clear the Cache of TYPO3 ;) And, check your frontend view source to see your GA <script> tag.

TYPO3 Extensions for Google Analytics

Here is the list of stable Google Analytics TYPO3 Extensions that will help you integrate at your TYPO3 website.

EXT.t3googleanalytics

An easy and essential Google Analytics extension for TYPO3. It's one of the only TYPO3 extensions which supports the latest TYPO3 LTS versions.

EXT.mindshape_seo

This extension gives you all the necessary functions to set up your website SEO to the best. Injection of analytics: Google Analytics Universal, Google Analytics 4, Google TagManager, Matomo.

EXT.google_analytics_and_adwords

This Extension provides an interface to implement Google Analytics and Google Ads by natively using the gtag library. With this extension, you can implement Universal Analytics, Google Analytics 4, and Google Ads together.

EXT.we_google_analytics (for TYPO3 6 to 8)

This Plugin will add the Google Analytics Code to your site automatically. All types of Google Analytics are supported (urchin.js, mobile, ga.js, and analytics.js). Easy use of Google's Cookie Law (Google's Opt-Out function via cookie) implementation.

TYPO3 Google Analytics (without GTM)

Well, we have been using several google analytics extensions for TYPO3 for years. But now, we think it would be a great thought to develop a TYPO3 extension purely based on TypoScript with an objective.

In this manner, we can trace the number of clients who see the final "thank you"- page, which is an important measurement. We use this metric to determine if the sales funnel is accurate and what adjustments should be made.

In our precise case, we need customers to join something, and we introduced many buttons pointing to the specific web page. Our web page has a form to be filled, then the contents are mailed, and the person is redirected to a particular web page. We do realize that this should be performed in Google Tag Manager (GTM) now; however, we decided upon the older manner till we migrate to GTM.

 

// Create “lib.GoogleAnalytics.typoscript” special GoogleAnalytics TypoScript Object
lib.GoogleAnalytics = COA
lib.GoogleAnalytics {
     10 = TEXT
    10.value (
        <script>
        (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','https://www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-YOURCODEHERE', 'auto');
    )
    30 = TEXT
    30.value (
        ga('send', 'pageview');
        </script>
    )
}

// Integrate Google Analytics Event at your “Thank you” success page
[globalVar = TSFE:id = YOURPAGEIDHERE]
lib.GoogleAnalytics.20 = TEXT
lib.GoogleAnalytics.20.value (
    ga('send', 'event', { eventCategory: 'Contact', eventAction: 'Submit', eventLabel: 'Contact Page Form', eventValue: 1});
)
[global]

// Don’t forget to include your Google Analytics TypoScript object
<INCLUDE_TYPOSCRIPT: source="EXT.yourextension/YouPath/lib.GoogleAnalytics.typoscript">

// And, Finally let’s call at your Footer Fluid Partial
<f:cObject typoscriptObjectPath="lib.GoogleAnalytics"/>

Wrapping-up!

Thanks for reading my article. I hope you learned well to integrate Google Analytics into our lovable TYPO3 CMS.

Do you know any better way to integrate Google Analytics into TYPO3 CMS? Or, Are you facing any problems integrating GA Code to your TYPO3 website? Feel free to write me to below comment box; I’ll be happy to help you :)

Have a Happy Researching with GA + TYPO3!

Post Comment

Your email address will not be published. Required fields are marked *

×

Name is required!

Enter valid name

Valid email is required!

Enter valid email address

Comment is required!

Google Captcha Is Required!

Comments :

  • Ron Lehmann September 10, 2021 At 11:12 am
    Hey there, Thanks for mentioning the reasons why a website needs google analytics. I have recently started my blog, the website is made with TYPO3 and I am also new to Google Analytics. Regarding the steps for Tracking Code, I don’t know if I am performing the steps right or not but on my console, I didn’t see any Tracking info tab.

    Also, Which Templates and Extensions do you recommend for faster loading and better performance of my TYPO3 website?

    PS:- I have also read your blog on 45+ TYPO3 Typoscript tips and tricks and it was a very good article to get started with TYPO3, can you suggest more articles and resources for a TYPO3 beginner?
  • Stefan Köhler September 8, 2021 At 11:30 am
    Hi Sanjay, Thanks for the in-depth explanation and resources, the blog is pretty nice and Google Analytics 4 seems promising but is there anything I can do on your portal?

    Maybe like guest posting or something? As I want to share my knowledge on Blog writing, SEO tips, and much more to increase the TYPO3 website’s visibility. What are the possibilities for the same?
  • Felix Werner September 7, 2021 At 12:30 pm
    You know, getting started with google analytics is easy but I found the google analytics code integration a little hard because I am kind of a newbie to the TYPO3 world. I manage a blog website, so you know why Google Analytics is important for me. I am leaning more towards TYPO3 and learning it day by day.

Everything About TYPO3 PWA (Progressive Web Application)

Are you thinking and planning to integrate Modern TYPO3 PWA to your TYPO3 website? If yes, then Congratulations! In this article,…

How to Enable TYPO3 HTTPS?

How to Enable TYPO3 HTTPS?

Are you looking for an all-in-one article about TYPO3 + HTTPS? Then, You are at the right place. What & Why HTTPS, How to…

Learn TYPO3 Custom Elements with Core Ways

Learn TYPO3 Custom Elements with Core Ways

In your journey of TYPO3 development, you may get questions like, How should I develop TYPO3 custom elements? Which are available…

Stay up to date with our recent TYPO3 Blogs, news, & updates