Google Analytics 4

This article gives you a step by step guide on how to setup Google Analytics 4 with your clickflow and information on all events

Heyflow avatar
Written by Heyflow
Updated over a week ago

For advanced analytics and in-depth insights, Heyflow integrates seamlessly with Google Analytics 4. This integration ensures that users can harness the full power of number one tracking tool to understand user behavior and make informed decisions.

This article covers

Heyflow-Screenshot – Tracking


Setup

💡 Tip: If you are new to Google Analytics 4 and have just finished naming your new account, skip to Step 4 – creating a new property.

1. Open Google Analytics and click Home in the left sidebar.

2. Click on Admin located in the bottom left corner of the window.

3. Click Create Property from the second column.

4. Enter all of the applicable details for your new property and click Next. (The property name is just an identifier, you can get creative!)

5. Enter the remaining optional information and then click Create.

6. Select Web as a platform to set up a data stream.

7. Set up your data stream by entering your site URL and stream name. For the website URL, you can insert heyflow.id/<your-flow-id>. For the Stream name, you can get creative – that’s just for you to identify the stream. How about “My first Heyflow”? Turn on or off the Enhanced Measurement to your preference. Then, click Create Stream.

🔎 Enhanced Measurements simply let you measure more interactions within your page, in addition to page views such as scrolls or site search. In our setup, Page Views should be sufficient to get a good understanding of how users use your flow. However, if you would like to get more insights (that might be a bit confusing at times), enable the Enhanced measurement. In this guide, we’ll continue without the enhanced measurement and just the page views.

8. After the data stream is created, you’ll see the Measurement ID. Click the copy icon on the top right of the page to copy your Measurement ID. Next, open your flow on go.heyflow.app.

9. Navigate to the Integrate > Analytics tab at the top of the window inside the Heyflow app.

10. Under the Google Analytics 4 section, paste the Measurement ID. Then click Save.

If saving the Google Analytics tag does not work, try to disable your ad blocker and try again.

11. Press Publish in the top right corner to publish your flow.

❗ Important: Google Analytics 4 will only work after you save the updated integrations, and you have published your flow.

12. You can now analyze your flow using Google Analytics 4 by switching back to the main dashboard of Google Analytics.

Great! You are now all set to use Google Analytics 4 for any reports or analysis of your data. Please allow 24-48 hours for the data to be collected and displayed in your Google Analytics dashboard.

🔎 You can also set up Google Tag Manager along with your Google Analytics 4. Navigate to our Google Tag Manager Setup page for more details!


Events

This guide is only applicable to Tracking Version 1.0 and above. Make sure your heyflow is using Version 1.0 in your heyflow settings under tracking:

Triggers and Event Names

By default, (if you don't use your own Google Tag Manager), Google Analytics 4 (GA4) events are closely related to the Heyflow Events API and the DataLayer. Check out the respective guides to gain more in-depth knowledge.

Based on your heyflow's lifecycle, events are emitted and passed to Google Analytics 4:

GA4 Event Name

heyflow-init

heyflow_start

heyflow-screen-view

page_view

heyflow-submit

heyflow_submit

heyflow-exit

heyflow_exit

heyflow-input-click

{{Custom Event Name*}}

heyflow-button-click

{{Custom Event Name*}}

The Custom Event Name that is passed as the Event Name to GA4 when an input or button is clicked (heyflow-input-click, heyflow-button-click), is set in your heyflow:

If that's not available, the following applies: for heyflow-input-click, the Custom Event Name fallback is the sanitized* System Label, Label, or block ID. For heyflow-button-click, the Custom Event name fallback is the block ID.

*) sanitized here means that it's cleaned of special characters and whitespaces, e.g. My System L@b3lMy_System_l_b_l. That's done for better compatibility with GA4 and other tools you might want to use.

Default Properties

By default, IP addresses are anonymized (anonymize_ip: true).

For all events, we define page_location, page_title, and page_referrer.

🔎 If you would like to change the schema, you can set up and link your own GTM container with custom properties. We supply a base configuration for you to start from.

page_referrer

For heyflow_start, the referrer is the HTTP referrer, e.g. https://google.com. For other events, including page_view, the referrer is the constructed URL of the last screen (explained below).

page_title

The page_title is the name of the screen.

page_location

The page_location schema is the following:

{{Origin}}{{Page Path}}/{{Screen Name}}{{Search Query}}.

❗ Important: We re-construct the page_location – it is not the actual URL. That is beneficial because your heyflow is a so-called Single-Page Application for which page_view and their location are not ideally tracked automatically.

Origin is the first part of the URL, e.g. https://heyflow.id. Page Path is only relevant when you have connected your own domain or when you have embedded your heyflow: for https://your-domain.com/some/sub/page, the Page Path is /some/sub/page. Then, after a /, the screen name follows, e.g. start (the word behind the # in the URL, usually). You can define the screen names in your heyflow yourself. The Search Query is whatever follows the URL with a question mark, e.g. in https://heyflow.id/my-flow?utm_campaign=spring01&gclid=abc123 Sometimes, it's also called Query String. That Search Query may contain URL parameters, e.g. utm_campaign or gclid.

A few examples for the page_location reconstruction:

Original URL

page_location

https://heyflow.id/my-flow

https://heyflow.id/my-flow

https://heyflow.id/my-flow#screen-name-abc

https://heyflow.id/my-flow/screen-name-abc

https://heyflow.id/my-flow#screen-xyz?utm_source=google&gclid=abc123

https://heyflow.id/my-flow/screen-xyz?utm_source=google&gclid=abc123

https://your-domain.com/#start-screen

https://your-domain.com/start-screen

https://your-domain.com/some/sub/page#some-screen

https://your-domain.com/some/sub/page/some-screen

https://your-domain.com/some/sub/page#some-screen?utm_source=google&gclid=abc123

https://your-domain.com/some/sub/page/some-screen?utm_source=google&gclid=abc123


Troubleshooting

I don't see any events in GA

Make sure you do not decline the Cookie Consent when testing the events in your heyflow and try disabling ad blocker and other extensions.

💬 If you're having any other issues with our Google Analytics integration, please contact the support.

Did this answer your question?