Foleon allows you to measure the performance of your Foleon Docs. Next to our built-in analytics, we also enable you to connect your Foleon Docs to Google Analytics 4 (GA4). This article shows you how to connect Foleon to GA4.
⚠️ Google Analytics 4 is replacing Google’s Universal Analytics (UA). Still using Universal Analytics? Migrate to GA4 to avoid missing out on data.
In this article
- What is Google Analytics?
- Why switch to Google Analytics 4 (GA4)?
- Connect GA4 to Foleon
- What does Google Analytics track?
What is Google Analytics?
Google Analytics is a free web analytics tool offered by Google to help you analyze your website traffic. It’s the most widely used web analytics service on the web.
Simply put, Google Analytics records various activities of visitors when they visit a website, along with the attributes (such as age, gender, and interests) of those visitors. It then sends all that information to the Google Analytics servers once a visitor leaves a website.
💡In order to analyze the performance of our platform, we also include our own Google Analytics code (UA-36092362-3) in every published Foleon Doc. IP addresses are anonymized by default for this property.
Why switch to Google Analytics 4 (GA4)?
Earlier this year, Google announced its plan to terminate Universal Analytics (UA) on July 1st, 2023. The newer Google Analytics 4 — also known as GA4 — is officially replacing Universal Analytics.
This means marketers and web analysts worldwide who are familiar with Universal Analytics must migrate to a GA4 setup.
⚠️ If you're switching from UA to GA4, you'll need to change the analytics tracking ID in Foleon. Because UA and GA4 are different platforms, you won't keep the historic data (UA) and new data (GA4) in one place.
Connect GA4 to Foleon
Step 1: Make sure you have a Google Analytics account
If you haven’t already, you can easily create a Google Analytics account by following these instructions from Google (it’s free!):
Step 2: Set up a property
Once you’ve created an account (or have logged in to an existing account), you can connect GA4 to Foleon.
Google Analytics works with so-called “Properties”, these allow you to split up data if you’re using the same Google Analytics account for different websites.
We recommend creating a separate property for each project in Foleon. This allows you to compare different Foleon Docs within a project without needing to filter out data from Foleon Docs in other projects.
If you haven't created a property yet, follow these instructions from Google:
Step 3: Get your tracking "G-" measurement ID
Once you’ve created a GA4 property for your project, you retrieve the tracking “G-” measurement ID to connect Google Analytics to Foleon.
Follow these instructions from Google to find your Google Analytics 4:
Step 4: Add your tracking code to Foleon
Once you’ve created a Google Analytics property for a specific project, go to the Foleon dashboard. From the projects menu, select the project you want to connect to the Google Analytics property (or create a new project).
Next, open the project settings.
Scroll down to the Google Analytics section.
Insert your measurement ID within Google Analytics 4 (GA4). If you want to check the advanced settings, continue to step 5. If you’re okay with the default settings, click Save. That’s it.
⚠️ Do you already have live Foleon Docs in the project? Republish all live Foleon Docs in the project for the changes to take effect.
You’ve now connected the Google Analytics property to all Foleon Docs in this project. If you’ve created several properties for different projects, repeat this process for each project.
Step 5 (optional): Check the advanced settings
When you click advanced settings, you’ll see two additional options. You can change these settings if your Google Analytics setup requires a custom approach.
⚠️ If you’re unsure, we recommend not changing these options unless it’s necessary, as the default settings provide you with the most insights from Foleon-specific events.
Before changing these toggles, check your enhanced measurement options in GA4. We go over these two settings below:
Send additional engagement events to GA4 — ✅ This toggle is on by default.
If enabled, you enrich your GA4 data with Foleon-specific events (e.g., clicks on navigation and overlays). This helps you analyze and visualize how your audience reads your Doc.
We recommend keeping this enabled to make the most of your analytics. You could, for example, disable this if you prefer to stick to the generic Google Analytics 4 events.
Let Foleon detect and track page changes instead of GA4 — ❌ This toggle is off by default and can cause duplicate data if turned on.
We recommend keeping this disabled to ensure GA4 is responsible for tracking page changes.
Foleon Docs are single-page applications (SPA). This means content changes dynamically, and a page change is simulated. In reality, you've stayed on the same page. That's why the Foleon platform and Foleon Docs require only a single page load, ensuring loading speed while navigating the content.
By default, GA4 detects and tracks these simulated page changes. Only if you have disabled GA4 to track simulated page changes automatically, then we recommend enabling this toggle. If enabled, Foleon will detect and track whenever a reader changes to another page changes.
If you want to enable this option in Foleon, you'll have to ensure you have the correct setup in Google Analytics 4 to avoid duplicate data.
First, in GA4, click admin, and then data streams.
Open up your web data stream.
Next, click the gear icon to open the enhanced measurement settings.
Click show advanced settings under page views. If both boxes are checked, we recommend not enabling Let Foleon detect and track page changes instead of GA4.
What does Google Analytics track by default?
Google Analytics keeps track of many metrics, such as pageviews, button clicks, and scroll depth. At its most basic level, it collects:
Duration of visit, pages visited, and time spent on each page
Referring site details
Type of web browser
Type of operating system
Network location and IP address
As you can tell, it enables you to see how the content on your site is performing, but it also gives you access to detailed information on your site's visitors.
Under the GDPR, an IP address is considered personal data because it can be used to identify a person. You may want to anonymize IP addresses, so they’re not recorded in Google Analytics. You can do this in Foleon Doc settings > Marketing > Anonymize IP.
⚠️ A Doc's preview link (e.g., https://example.viewer.foleon.com) is not tracked with Google Analytics. To see data in Google Analytics, share the URL of your published Foleon Doc (e.g., https://example.customdomain.com).
Next to the standard analytics, we also keep track of a wide range of events in Foleon Docs (e.g. button clicks, scroll depth). We’ll talk about this more in-depth in the article: Getting further insights with Google Analytics events.