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