|
1 | 1 | ---
|
2 |
| -id: getting-started |
3 |
| -title: Getting Started |
4 |
| -slug: '/integrations/google-analytics' |
| 2 | +slug: /integrations/google-analytics |
| 3 | +title: Google Analytics |
| 4 | +description: Learn how to setup Google Analytics in FluterFlow |
| 5 | +tags: [Google Analytics] |
| 6 | +sidebar_position: 1 |
| 7 | +keywords: [Google Analytics, Firebase, Firebase Analytics, Track App Events] |
5 | 8 | ---
|
6 | 9 |
|
7 | 10 | # Google Analytics
|
8 | 11 |
|
9 |
| -Google Analytics allows you to track app-related events. |
| 12 | +Integrating Google Analytics into your FlutterFlow project enables you to monitor user interactions, track app performance, and gain valuable insights to enhance user experience. Here's a comprehensive guide on setting up and utilizing Google Analytics within FlutterFlow. |
10 | 13 |
|
11 |
| -## Setup |
12 |
| - |
13 |
| -Simply navigate to **Settings and Integrations** > **Integrations** > **Google Analytics** and turn on the **Enable Google Analytics** toggle. You can see all the logged events inside the Analytics dashboard of your [Firebase console](https://console.firebase.google.com/). |
| 14 | +:::tip |
14 | 15 |
|
15 |
| -## Default Events |
16 |
| -Currently, we support automatic logging for the following events: |
| 16 | +Google Analytics is integrated into Firebase. This means you must [**set up Firebase**](../../firebase/connect-to-firebase-setup.md) to enable analytics tracking and log events from your FlutterFlow app. |
17 | 17 |
|
18 |
| -* **On Page Load**: This logs an event when a user opens a page. It is logged with the Firebase recommended name, i.e., **screen_view,** but you will find the actual screen name, i.e., page title, inside the parameter (click on the screen_name to reveal the parameter). |
| 18 | +::: |
19 | 19 |
|
20 |
| -* **On Action Start**: This logs an event when a user interacts with widgets to trigger an action. It will be logged as |
21 |
| -`{WIDGET_NAME}_{TRIGGER_TYPE}` For example, when the user taps a button and navigates to the |
22 |
| - next page, the event will be logged as **Button_navigate_to**. |
| 20 | +## Enable Google Analytics in Firebase |
| 21 | + |
| 22 | +To enable Google Analytics in Firebase, open the [Firebase Console](https://console.firebase.google.com/) and select your project. From the left-side menu, navigate to **Analytics > Dashboard** and click **Enable Google Analytics**. Choose an existing Google Analytics account or create a new one, then **Finish** the setup. |
| 23 | + |
| 24 | +<div style={{ |
| 25 | + position: 'relative', |
| 26 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 27 | + height: 0, |
| 28 | + width: '100%'}}> |
| 29 | + <iframe |
| 30 | + src="https://demo.arcade.software/QJY4MZVonDmVgIcexK6t?embed&show_copy_link=true" |
| 31 | + title="" |
| 32 | + style={{ |
| 33 | + position: 'absolute', |
| 34 | + top: 0, |
| 35 | + left: 0, |
| 36 | + width: '100%', |
| 37 | + height: '100%', |
| 38 | + colorScheme: 'light' |
| 39 | + }} |
| 40 | + frameborder="0" |
| 41 | + loading="lazy" |
| 42 | + webkitAllowFullScreen |
| 43 | + mozAllowFullScreen |
| 44 | + allowFullScreen |
| 45 | + allow="clipboard-write"> |
| 46 | + </iframe> |
| 47 | +</div> |
| 48 | +<p></p> |
| 49 | + |
| 50 | +## Enable Google Analytics in FlutterFlow |
| 51 | + |
| 52 | +To begin collecting analytics data, navigate to **Settings and Integrations > Integrations > Google Analytics** within your FlutterFlow project and toggle on the **Enable Google Analytics** option. |
| 53 | + |
| 54 | +Once enabled, you can set the [Predefined Events](#predefined-events). You can selectively toggle these options to log specific user interactions automatically. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +### Predefined Events |
| 59 | + |
| 60 | +You can enable automatic logging for the following events: |
| 61 | + |
| 62 | +- **On Page Load**: Logs an event when a user opens a page, recorded with the Firebase-recommended name `screen_view`. The actual screen name is accessible within the `screen_name` parameter. |
| 63 | +- **On Action Start**: Captures events when users interact with widgets that trigger actions. Events are logged in the format `{WIDGET_NAME}_{TRIGGER_TYPE}`. For instance, if a user taps a button that navigates to another page, the event is logged as `Button_navigate_to`. |
| 64 | +- **On Each Individual Action**: This logs an event for every individual action or action chain for a given widget. It will be logged as `{WIDGET_NAME}_{TRIGGER_TYPE}` For example, when the user taps on a button and adds the *Upload Media* action followed by the *Update App State* action, the event will be logged as `Button_upload_media` and `Button_update_local_state`. |
| 65 | +- **On Authentication**: Logs events for authentication-related actions such as sign-up, login, logout, password reset, or account deletion. Events are logged using the action type, e.g., `sign_up` or `login`. |
23 | 66 |
|
24 |
| -* **On Each Individual Action**: This logs an event for every individual action or action chain for a given widget. It will be logged as `{WIDGET_NAME}_{TRIGGER_TYPE}` For example, when the user taps on a button and adds the *Upload Media* action followed by the *Update App State* action, the event will be logged as `Button_upload_media` and `Button_update_local_state`. |
| 67 | +:::tip |
25 | 68 |
|
26 |
| -* **On Authentication**: This logs an event for every authentication action. That means whenever you signup, log in, log out, reset your password, or delete your account. The event will be logged as `{ACTION_TYPE}` (e.g., sign_up, login, etc.). |
| 69 | +To easily identify widgets in the analytics dashboard, consider giving them recognizable names, such as `BuyButton` instead of just `Button`. |
27 | 70 |
|
28 |
| -:::tip |
29 |
| -To clearly identify the widgets (on which the events are logged) in the analytics dashboard, you can rename and provide an easily recognizable name to the widget (e.g., BuyButton instead of just Button). |
30 | 71 | :::
|
31 | 72 |
|
32 | 73 | ## Google Analytics Event [Action]
|
33 | 74 |
|
34 |
| -This action allows you to log custom events. By using this action, you can record additional information associated with the event in the form of parameters. |
35 |
| - |
36 |
| -Go to your project page on FlutterFlow and follow the steps below to define the Action to any widget. |
37 |
| - |
38 |
| -1. Select the **Widget** (e.g., Button) on which you want to define the action. |
| 75 | +In addition to predefined events, you can track specific user actions relevant to your app’s goals. This action allows you to log custom events and record additional information through parameters. |
39 | 76 |
|
40 |
| -2. Select **Actions** from the [Properties Panel](../../../intro/ff-ui/builder.md#properties-panel) (the right menu), and click **+ Add Action**. |
41 |
| - * Search and select the **Google Analytics Event** action. |
42 |
| - * Enter the name of the event in the **Value** input field. This name will be displayed on |
43 |
| - the Analytics dashboard. |
44 |
| - |
45 |
| - |
46 |
| -:::note |
47 |
| -All the logged events can be accessed from the Analytics dashboard of your [Firebase console](https://console.firebase.google.com/). |
48 |
| -::: |
49 |
| - |
50 |
| -:::tip |
51 |
| -Event names must be 40 characters or less. Event names may only contain alphanumeric characters and underscores ("_"), and must start with an alphabetic character. |
52 |
| -::: |
| 77 | +For example, in an e-commerce app, you might log product purchases with parameters such as `product_category: electronics` to track item categories and `user_role: premium` vs. `user_role: guest` to differentiate user types. |
53 | 78 |
|
54 |
| -<figure> |
55 |
| -  |
56 |
| - <figcaption class="centered-caption">Adding Google Analytics Event Action</figcaption> |
57 |
| -</figure> |
| 79 | +To log a custom event, add the **Google Analytics Event** action and enter a clear, descriptive **Event Name**. You can add parameters for extra context by clicking **+ Add Parameter** and providing **Key**-**Value** pairs (e.g., `product_category` as the Key and `electronics` as the Value). |
58 | 80 |
|
59 |
| -### Add Parameters |
| 81 | + |
60 | 82 |
|
61 |
| -At times, you may need to log additional details such as the time, user type, and widget placement when an event occurs. |
| 83 | +## Viewing Analytics Data |
62 | 84 |
|
63 |
| -Here's how you can log an event by the tab name when a tab within the TabBar is selected or changed: |
| 85 | +To see all tracked events, both automatic and custom, open the [Firebase Console](https://console.firebase.google.com/) and select your project. From the left-side menu, navigate to **Analytics > Dashboard** to access detailed event reports. |
64 | 86 |
|
65 |
| -1. Select the **Tab** (inside TabBar) on which you want to define the action. |
| 87 | +Use this data to gain insights into app screens, which funnels convert best, and where churn or drop-offs occur. In the long run, these metrics help you make data-driven improvements that enhance the user experience and maximize the impact of your FlutterFlow app. |
66 | 88 |
|
67 |
| -2. Select **Actions** from the [Properties Panel](../../../intro/ff-ui/builder.md#properties-panel) (the right menu), and click **+ Add Action**. |
68 |
| - * Search and select the **Google Analytics Event** action. |
69 |
| - * Enter the name of the event in the **Value** input field, such as *Tabbar_On_Tap*. |
70 |
| - * Click on the **+ Add Parameter** and open the **Param 1** section. |
71 |
| - * Inside the **Key** section, enter **Value** as **Tab_Name**. |
72 |
| - * Inside the **Value** section, enter the **Value** as the name of the tab (e.g., *Upcoming*, |
73 |
| - *Past)*. |
74 |
| - |
75 |
| -3. Similarly, add this action for other tabs as well. |
| 89 | +## FAQs |
76 | 90 |
|
77 |
| - |
| 91 | +<details> |
| 92 | +<summary> |
| 93 | +Why don’t I see any Analytics data yet? |
| 94 | +</summary> |
| 95 | +<p> |
| 96 | +Event data may not appear instantly, which can be frustrating during development. Firebase may take up to **24 hours** to display event data in the main dashboards. Ensure your device has internet access and you’ve used the app at least once since enabling Analytics. |
| 97 | +</p> |
| 98 | +</details> |
0 commit comments