Documentation

Google Analytics

Track user interactions and events in your embeddables using Google Analytics 4 through the Measurement Protocol.

Setting Up Google Analytics 4 with Embeddable

You can track user interactions and events in your components by connecting Google Analytics 4 (GA4) through the Measurement Protocol. This lets you measure engagement, conversions, and performance directly inside your Google Analytics dashboard.


How to Connect Google Analytics 4

1. Navigate to Integrations

From the main editor screen, click the Integrations icon (the plug) in the top-right corner.

2. Select Google Analytics

Find Google Analytics in the integrations list and click Connect.

3. Choose or Create a Credential

In the Select credential dropdown, you can:

  • Select an existing credential if you've already connected Google Analytics in this project.
  • Or click Create New Credential if this is your first time.

4. Create a New Credential (First-Time Setup)

If creating a new credential, fill in the following fields:

  • Credential Name: A recognizable name (e.g., "GA4 Main Property").
  • Description (Optional): Add a note for clarity.
  • Measurement ID (Required): Your GA4 Measurement ID (format: G-XXXXXXXXXX).
  • API Secret (Required): The API secret associated with your GA4 property.

Click Create Credential to save.

5. Connect the Credential

Return to the dropdown, select your newly created credential, and click Connect.


Testing Your Integration

Once connected, events from your component will be sent to GA4. To verify:

  1. Log into Google Analytics.
  2. Go to Reports > Real-Time.
  3. Trigger an event in your component (e.g., form submission).
  4. Confirm the event appears in real-time reporting.

Best Practices

  • Always use the correct Measurement ID from the GA4 property you want to track.
  • Keep your API Secret secure — never expose it in client-side code.
  • Use GA4 DebugView for testing event flows before going live.
  • Consider creating a separate property or data stream for testing and staging environments.

On this page