# Amplitude

- Tool: Bubble
- Difficulty: Intermediate
- Time required: 45–90 minutes
- Last updated: July 2026

## TL;DR

Connect Bubble to Amplitude using the API Connector plugin in two modes: send product events to Amplitude's HTTP API v2 ingestion endpoint (your api_key in the JSON body), and read analytics data via the Dashboard REST API using Basic Auth with your api_key and secret_key both marked Private. The key Bubble-specific gotcha: EU-region Amplitude projects must use a different base URL — the US endpoint silently discards EU events while returning HTTP 200.

## Two ways to use Amplitude in a Bubble app

Most Bubble builders start with the same question: should I send events to Amplitude, pull data back from it, or both? The answer depends on what you want to build. Sending events gives Amplitude the raw behavioral data it needs to build cohorts, retention curves, and funnels — you fire an event every time a user completes a meaningful action in your Bubble app (sign up, purchase, feature use). Reading data pulls computed analytics back into Bubble so you can display metrics inside dashboards, admin panels, or customer-facing reports.

Bubble's API Connector handles both directions server-side. For ingestion, Amplitude's HTTP API v2 accepts a simple JSON body — no base64 encoding, no special wrapping — making this one of the cleaner analytics ingestion setups in the API Connector. For reading data, the Dashboard REST API uses HTTP Basic Auth with your API key and secret key, which the API Connector supports natively via its Authentication tab.

The one critical region check: if your Amplitude project is hosted in the EU data region, the ingestion URL changes from api2.amplitude.com to api.eu.amplitude.com — and using the wrong URL causes silent data loss (HTTP 200 response, zero events recorded). Always verify your project's data residency before writing a single Bubble configuration field.

## Before you start

- A Bubble app on any plan (event ingestion works on all plans; reading Dashboard REST API data requires verifying your Amplitude plan supports API access)
- An Amplitude account — Starter plan is free and supports unlimited event ingestion
- Your Amplitude API key and secret key from Settings → Projects → your project → General
- Your Amplitude project's data residency setting confirmed (US or EU) — this determines which base URLs to use
- The API Connector plugin installed in your Bubble app (Plugins tab → Add plugins → search 'API Connector')

## Step-by-step guide

### 1. Find your Amplitude API key, secret key, and confirm data residency

Before touching Bubble, collect the three pieces of information you need: your ingestion API key, your secret key, and your project's data residency region. In Amplitude, click your project name in the top-left to open the project switcher, then go to Settings (gear icon) → Projects → select your project → General tab. Copy the API Key (used for event ingestion — this is semi-public) and the Secret Key (used for reading data via the Dashboard REST API — keep this private). Scroll down on the same General tab to the Data Residency section. If it shows 'EU,' you must use EU-region API URLs in Bubble. If it shows 'US' or nothing special, use the standard US URLs. Write down all three values before continuing — you will need them in the next steps. Note: The secret key is only shown once when the project is created for some account types — if you cannot find it, you may need to generate a new one under Security in your project settings.

**Expected result:** You have your Amplitude API key, secret key, and know whether your project uses US or EU data residency.

### 2. Install the API Connector and create the event ingestion call

In your Bubble editor, click the Plugins tab in the left sidebar. Click 'Add plugins', search for 'API Connector' (by Bubble), and install it — it is free. Once installed, you will see 'API Connector' appear in your Plugins list. Click it to open the configuration panel.

Click 'Add another API' and name it 'Amplitude Ingestion'. Leave the Authentication dropdown set to 'None or self-handled' (you will put the api_key in the body, not headers). You do not need shared headers for ingestion.

Click 'Add another call' under this API group and name it 'Send Events'. Set the request type to POST. In the URL field enter your ingestion endpoint:
- US region: https://api2.amplitude.com/2/httpapi
- EU region: https://api.eu.amplitude.com/2/httpapi

Click 'Add parameter' under the Body section and set the body type to 'JSON body'. In the JSON body field, enter:

```json
{
  "api_key": "<api_key>",
  "events": [
    {
      "user_id": "<user_id>",
      "event_type": "<event_name>",
      "time": <timestamp>,
      "event_properties": {}
    }
  ]
}
```

For the api_key field, Bubble will parse this as a dynamic field you can initialize. When you see the field appear below the JSON body editor, check the 'Private' checkbox next to api_key to prevent it from appearing in Bubble's Logs tab — even though it is semi-public, you do not want it logged in plain text. Set the field type to 'Text' and the key name to 'api_key'.

For user_id, event_name, and timestamp — these remain as dynamic fields you will populate from Bubble Workflows at runtime. Set each as 'Text' type (timestamp as 'Number').

Change the 'Use as' dropdown to 'Action' since you are triggering this from a Workflow, not fetching data to display.

Click 'Initialize call'. In the initialization panel, fill in test values: api_key = your actual Amplitude API key, user_id = 'test-user-123', event_name = 'Test Event', timestamp = 1700000000000 (any Unix timestamp in milliseconds). Click 'Send'. You should see a 200 response with body: `{"code": 200, "events_ingested": 1, "payload_size_bytes": N, "upload_time": N}`. If you see `"events_ingested": 0`, check that event_type is not empty. If you see a network error, double-check you used the correct regional URL.

```
{
  "api_key": "<api_key - Private>",
  "events": [
    {
      "user_id": "<user_id>",
      "event_type": "<event_name>",
      "time": <timestamp>,
      "event_properties": {
        "plan": "<plan_name>",
        "source": "<source>"
      }
    }
  ]
}
```

**Expected result:** The Initialize call returns HTTP 200 with events_ingested: 1. The 'Send Events' call now appears as an action you can use in Bubble Workflows.

### 3. Trigger Amplitude events from Bubble Workflows

Now connect the API Connector call to real user actions in your Bubble app. Open the Workflow editor by clicking 'Workflow' in the top menu bar. You will create Workflow actions that fire the 'Send Events' API Connector call at the right moments.

For each key product event, create a Workflow or add a step to an existing Workflow:

1. Click 'Click here to add an event' and select the trigger — for example, 'A Button is clicked' (e.g., your Sign Up button, Purchase button, or a key feature button).
2. Add a new step: click 'Click here to add an action' → Plugins → 'Amplitude Ingestion - Send Events'.
3. In the action's parameter fields, map dynamic values:
   - api_key: paste your Amplitude API key (this field is Private, so it will not appear in logs)
   - user_id: Current User's unique ID (use 'Current User' → 'Unique ID' in the dynamic dropdown)
   - event_name: type the event name in quotes, e.g., 'Sign Up' or 'Purchase Completed'
   - timestamp: use 'Current date/time' and format it as a Unix timestamp in milliseconds

For anonymous users who are not yet logged in, you cannot use Current User's ID. Instead, generate a UUID when the user first visits your app and store it in a browser cookie using Bubble's Toolbox plugin (Run JavaScript action). Pass this stored value as the device_id parameter instead of user_id. You can include both user_id and device_id simultaneously once the user logs in — Amplitude will merge the anonymous and identified event histories.

Repeat this for each important event: page views, form submissions, feature interactions, purchases. Good events to track in a typical Bubble SaaS app: 'Page View', 'Sign Up', 'Feature Used', 'Purchase Completed', 'Invitation Sent'.

After triggering a few test events, go to Amplitude → User Look-Up (left sidebar) or Events tab → Ingestion Debugger to verify they appear. Events typically appear within 30 seconds in the Ingestion Debugger and within a few minutes in User Look-Up.

**Expected result:** Test events appear in Amplitude's Ingestion Debugger within 30 seconds of being triggered. You can see the event_type, user_id, and event_properties populated correctly.

### 4. Create the Dashboard REST API call for reading analytics data

To pull analytics data back into Bubble — for admin dashboards, reports, or displaying engagement metrics inside your app — set up a second API Connector group that authenticates using Basic Auth with your API key and secret key.

In the API Connector plugin, click 'Add another API' and name it 'Amplitude Dashboard'. Click the Authentication dropdown and select 'HTTP Basic Auth'. In the Username field, enter your Amplitude API key. In the Password field, enter your Amplitude secret key. Check the 'Private' checkbox on both fields — these credentials give read access to your analytics data and must be kept server-side.

Click 'Add another call' under 'Amplitude Dashboard' and name it 'Get Event Segmentation'. Set the request type to GET. In the URL field, enter the segmentation endpoint:
- US region: https://amplitude.com/api/2/events/segmentation
- EU region: https://analytics.eu.amplitude.com/api/2/events/segmentation

Add URL parameters (Query Parameters section):
- e: the event JSON (e.g., `{"event_type":"Sign Up"}`)
- start: start date in YYYYMMDD format (e.g., 20240101)
- end: end date in YYYYMMDD format
- m: metric type (e.g., 'uniques' for unique users, 'totals' for event counts)
- i: interval in days (1 for daily, 7 for weekly, 30 for monthly)

Change 'Use as' to 'Data' since you will bind the results to page elements.

Click 'Initialize call'. Fill in test values: e = `{"event_type":"Sign Up"}`, start = a date 30 days ago in YYYYMMDD format, end = today's date in YYYYMMDD format, m = 'uniques', i = 1. Click 'Send'. You should receive a JSON response like:

```json
{
  "data": {
    "series": [[N, N, N, ...]],
    "xValues": ["YYYY-MM-DD", "YYYY-MM-DD", ...],
    "seriesCollapsed": [[{"value": N}]]
  }
}
```

Bubble will automatically detect the response structure. If the initialize call fails with 403, verify that your Amplitude plan supports Dashboard REST API access — the secret key and API key must match the project and the plan must include API access.

```
GET https://amplitude.com/api/2/events/segmentation
Authorization: Basic base64(api_key:secret_key)  [handled automatically by API Connector Basic Auth]

Query Parameters:
  e={"event_type":"Sign Up"}
  start=20240601
  end=20240701
  m=uniques
  i=1

Response:
{
  "data": {
    "series": [[12, 24, 31, 18, 29, 40, 33]],
    "xValues": ["2024-06-01", "2024-06-02", "2024-06-03", "2024-06-04", "2024-06-05", "2024-06-06", "2024-06-07"],
    "seriesCollapsed": [[{"value": 187}]]
  }
}
```

**Expected result:** The Initialize call returns a JSON response with data.series containing an array of daily counts and data.xValues containing matching dates. The 'Get Event Segmentation' call appears as a Data source you can bind to Repeating Groups.

### 5. Bind analytics data to Bubble page elements

With the Dashboard REST API call initialized, you can now display Amplitude data on Bubble pages. The most common pattern is a Repeating Group that shows a daily event count table, but you can also bind totals to Text elements for summary stats.

To display a daily trend table:
1. Add a Repeating Group element to your page. Set 'Type of content' to 'text' (for the date column) — or create a custom data type to hold Amplitude results.
2. The cleaner approach: on page load, run a Workflow that calls 'Amplitude Dashboard - Get Event Segmentation' and stores the results in Custom States on the page. Set up a Custom State of type 'text' (list) for xValues and another Custom State of type 'number' (list) for the series data.
3. In the Workflow action, after the API call, add steps to 'Set state' using the returned data: xValues list → date state, series[0] list → count state.
4. In the Repeating Group, set 'Data source' to the date Custom State list. In the first column, display 'Current cell's text' (the date). In the second column, add a Text element and use 'Parent group's index' to index into the count Custom State list.

For a total count display (e.g., 'Total sign-ups this month'), use the seriesCollapsed field — it returns the sum for the period. Add a Text element on your page and in its value, use 'Do a search for' or bind to a Custom State that holds the collapsed total.

Important: cache results in the Bubble database when possible. Each API call to Amplitude consumes Workload Units on Bubble's infrastructure. For dashboards viewed frequently, run a scheduled Backend Workflow (paid plan) once per hour to refresh the cached data, and bind page elements to the Bubble database instead of making live API calls on every page load.

Add Bubble privacy rules to any data type you create to store Amplitude results — go to Data tab → Privacy → [your data type] → and restrict access to logged-in users or admins only.

**Expected result:** Your Bubble page displays a table or summary showing Amplitude event counts, populated from the Dashboard REST API. Data refreshes when the page loads or when the cached Bubble database record is updated by a scheduled Backend Workflow.

### 6. Verify events in Amplitude and handle common edge cases

Before going live, run a verification pass to confirm everything works end-to-end.

Verify event ingestion:
1. Trigger each of your Bubble Workflows that send events (click the buttons, submit the forms, complete the actions in your test environment).
2. In Amplitude, go to Data → Ingestion Debugger (left sidebar under Data). Look for your test events — they should appear within 30 seconds with the correct event_type, user_id, and event_properties.
3. If events appear with `events_ingested: 0` in the API response, check that event_type is not an empty string and that either user_id or device_id is present in every event.
4. If events do not appear in Ingestion Debugger at all despite HTTP 200 responses from the API call, this is the EU region silent failure — go back to your Amplitude project Settings → General → Data Residency and compare to your API Connector URL. Switch to the EU endpoint if needed.

Verify Dashboard REST API reads:
1. Open your analytics dashboard page in Bubble's Preview mode.
2. Check that the Repeating Group or Text elements populate with real data.
3. If you receive a 403 error from the Dashboard REST API, verify that your Amplitude plan includes API access. The Starter free plan may restrict Dashboard REST API access — check your plan in Amplitude Settings → Billing.
4. If you receive a 401, double-check that the API key (username) and secret key (password) in the API Connector's Basic Auth settings match the project you are querying.

Event taxonomy best practices before launch:
- Use consistent event_type naming across all Bubble Workflows: use snake_case or Title Case and stick to one convention ('sign_up' not 'Sign Up' in one place and 'user_signed_up' in another)
- Always include user_id for logged-in users — events without user_id cannot be tied to retention or LTV cohorts
- Add event_properties that give context: plan name, feature name, source page

Check the Bubble Logs tab (Logs → Workflow logs) to confirm API calls are completing without errors and to monitor WU consumption. If you see high WU usage, consider batching multiple events into a single API call using Bubble's 'List of' text constructor to build the events array.

**Expected result:** All test events appear in Amplitude's Ingestion Debugger with correct event types, user IDs, and properties. The Dashboard REST API returns data without errors. You have confirmed the correct regional endpoint is in use.

## Best practices

- Always mark api_key as Private in the API Connector even though it is technically semi-public for ingestion — preventing it from appearing in Bubble's Logs tab protects you from accidental exposure and keeps security hygiene consistent across all credentials.
- Confirm your Amplitude project's data residency region before writing a single API Connector field. The EU silent failure (HTTP 200, zero events recorded) is the most common cause of lost analytics data and wasted debugging time.
- Send user_id (Current User's Unique ID) on every event for authenticated users. Events without user_id cannot be tied to retention cohorts, LTV calculations, or any user-level analysis — the most valuable Amplitude features become unavailable.
- Batch events where possible: send multiple events in a single API call by building an events array in your Bubble Workflow using List operations. This reduces Workload Unit consumption significantly for high-traffic apps, since each API Connector call consumes WUs regardless of how many events it contains.
- Cache Dashboard REST API results in the Bubble database using a scheduled Backend Workflow (paid plan). Run the segmentation query once per hour and store results in a Bubble data type — bind page elements to the database, not to live API calls, to avoid per-page-load WU cost and to make your dashboard load faster.
- Add Bubble privacy rules to any data type that stores Amplitude API responses. Go to Data tab → Privacy → your data type → restrict read access to logged-in users or Admin roles to prevent raw analytics data from being exposed to unauthorized API requests.
- Use consistent event_type naming from the start. Amplitude cannot rename event types retroactively — establish a naming convention (e.g., snake_case verbs: 'sign_up', 'feature_used', 'purchase_completed') and document it before building Workflows, to avoid duplicate or fragmented event data.
- Verify each new event in Amplitude's Ingestion Debugger before building dashboards on top of it. The ingestion endpoint returns 200 even for malformed events — always confirm events_ingested equals the number of events in your payload, not 0.

## Use cases

### Track user signups and activation milestones

Fire an Amplitude event from your Bubble 'User signs up' Workflow so your product team can measure sign-up-to-activation rates, build cohorts of users who completed onboarding versus those who dropped off, and run A/B tests on onboarding flows.

Prompt example:

```
When a new User is created, send an Amplitude event called 'Sign Up' with user_id = the new user's unique ID, event_properties.plan = the selected plan name, and event_properties.source = the referral source stored on the User.
```

### Build an analytics dashboard inside a Bubble admin panel

Pull event segmentation data from the Amplitude Dashboard REST API and display it in a Bubble Repeating Group or chart element, so internal teams can see daily active users, feature adoption trends, or retention curves without leaving the Bubble app.

Prompt example:

```
On page load, call the Amplitude Dashboard REST API segmentation endpoint for the 'Feature Used' event over the last 30 days, retrieve the daily unique count series, and bind the xValues dates and series values to a Repeating Group to display a trend table.
```

### Log purchases and revenue events for funnel analysis

When a Stripe payment succeeds (captured via a Bubble Backend Workflow webhook), fire an Amplitude 'Purchase' event with revenue, product name, and user ID so your growth team can measure payment funnel conversion and calculate LTV cohorts.

Prompt example:

```
After the Stripe payment intent webhook fires and the Bubble database is updated, call the Amplitude ingestion API with event_type='Purchase', revenue=the payment amount divided by 100, event_properties.product=the purchased plan name, and user_id=the current user's unique ID.
```

## Troubleshooting

### API Connector returns HTTP 200 but Amplitude shows events_ingested: 0

Cause: The event payload is missing required fields — either event_type is an empty string or both user_id and device_id are absent from the event object. Amplitude returns 200 for structurally valid requests even when the event cannot be processed.

Solution: Open Bubble's Workflow debugger (click 'Debug mode' in the Preview toolbar) and inspect the exact JSON being sent by the API Connector call. Verify that event_type is a non-empty string and that at least one of user_id or device_id is present. For logged-in users, use 'Current User's Unique ID' in the user_id field — not the User's email or name, which may contain spaces or special characters that cause parsing issues.

### Events send successfully (events_ingested: 1) but never appear in Amplitude charts or User Look-Up

Cause: EU data residency silent failure — your Amplitude project is hosted in the EU region but you are sending events to the US ingestion endpoint (api2.amplitude.com). The US endpoint accepts EU-project events and returns 200, but discards them without routing to your project's EU data store.

Solution: Go to Amplitude Settings → Projects → your project → General → Data Residency. If it shows 'EU', update your API Connector call URL to https://api.eu.amplitude.com/2/httpapi. Click 'Re-initialize call' in the API Connector after changing the URL. Resend test events and verify in Ingestion Debugger — EU project events will now appear within 30 seconds.

### Dashboard REST API returns 403 Forbidden when reading analytics data

Cause: Either the Amplitude plan does not include API access, the API key and secret key are from a different project than the one being queried, or the EU vs US API endpoint mismatch applies to the Dashboard REST API as well.

Solution: First, verify your Amplitude plan supports Dashboard REST API access (Settings → Billing — Starter free plans may not include it). Second, confirm the API key and secret key in your API Connector Basic Auth settings match the exact project you want to query. Third, check your data residency: EU projects must use https://analytics.eu.amplitude.com/api/2/events/segmentation instead of the US endpoint. Update the URL in the API Connector and re-initialize.

### 'There was an issue setting up your call' error during API Connector initialization

Cause: The initialize call did not receive a valid response — most commonly caused by a network error reaching the Amplitude endpoint, incorrect URL (typo or wrong region), or malformed JSON in the request body.

Solution: Click 'Initialize call' again. In the initialization dialog, verify the endpoint URL is exactly correct (no trailing spaces, correct region prefix). For the ingestion call, check that the JSON body is valid — all keys must be in double quotes, no trailing commas. Paste the body into a JSON validator first. For the Dashboard REST API call, confirm the query parameters are correct and that the Basic Auth credentials are filled in. If Bubble reports a network error, try the call from a REST client like Postman or Hoppscotch with the same credentials to rule out an Amplitude-side issue.

### Anonymous users' events cannot be linked to their account after sign-up

Cause: Amplitude tracks anonymous users by device_id. If the device_id used before sign-up is not passed alongside the user_id in the first authenticated event, Amplitude cannot merge the anonymous and identified event streams.

Solution: On the page where anonymous users first interact with your app, generate a UUID using Bubble's Toolbox plugin (Run JavaScript action: generate a random UUID and store it in a cookie). Pass this value as device_id on all pre-authentication events. When the user signs up or logs in, fire one event that includes both user_id AND device_id — Amplitude uses this to merge the two identities. After that, include only user_id in subsequent events.

## Frequently asked questions

### Do I need a paid Bubble plan to connect to Amplitude?

For basic event ingestion (sending events from Bubble Workflows to Amplitude), the free Bubble plan is sufficient — the API Connector plugin works on all plans. You only need a paid Bubble plan if you want to schedule token refresh, run Backend Workflow jobs for caching Dashboard REST API results, or use recurring workflows. Reading analytics data from the Dashboard REST API also does not require a paid Bubble plan, but it does require verifying that your Amplitude plan (not Bubble plan) includes Dashboard REST API access.

### My Bubble app is for a European audience — which Amplitude endpoints should I use?

Check your Amplitude project's data residency setting first: Settings → Projects → your project → General → Data Residency. If it shows 'EU', use these endpoints: ingestion → https://api.eu.amplitude.com/2/httpapi, Dashboard REST API → https://analytics.eu.amplitude.com/api/2/events/segmentation. If your project's data residency is 'US' (or shows no special region), use the standard endpoints: https://api2.amplitude.com/2/httpapi for ingestion and https://amplitude.com/api/2 for the Dashboard REST API. Using the wrong endpoint does not cause an error — it silently loses your data — so this check is mandatory.

### How do I track anonymous users before they sign up in my Bubble app?

Amplitude requires either user_id or device_id on every event. For anonymous users (not yet logged in), generate a UUID and store it in a browser cookie using Bubble's Toolbox plugin (Run JavaScript action). Send this UUID as device_id on all events before sign-up. When the user signs up or logs in, fire one event that includes both the device_id and the new user_id — Amplitude merges the anonymous and identified histories using this pair. After that, you can pass only user_id on subsequent events.

### The API Connector initialize call to Amplitude succeeds but I do not see events in my Bubble Workflow — what is wrong?

The API Connector call needs to be added as an action step inside a Workflow, not just initialized. Go to the Workflow editor, open the Workflow where you want to fire the event, click 'Click here to add an action', select Plugins, and choose 'Amplitude Ingestion - Send Events'. Then fill in the dynamic parameter values (api_key, user_id, event_name, timestamp). The initialize step only verifies the API connection — it does not automatically trigger the call in your app.

### How many Workload Units does sending events to Amplitude consume?

Each API Connector call from a Bubble Workflow consumes Workload Units. Sending one batch of events (even with 100 events in the array) costs one WU for the API call itself, plus the WU cost of the Workflow running. To minimize WU spend on analytics, batch multiple events into a single API call using Bubble's List operations to build the events array, rather than firing one API call per event. For Dashboard REST API reads, cache results in the Bubble database using a scheduled Backend Workflow so you make one API call per hour instead of one per page load.

### Can I use Amplitude's free Starter plan with this Bubble integration?

Yes, for event ingestion. Amplitude's free Starter plan supports unlimited event ingestion via the HTTP API v2, which is the main use case for most Bubble builders. The limitation is on the Dashboard REST API for reading data — some API access features are restricted to paid Amplitude plans (Plus, Growth, or Enterprise). Check your specific plan's API access in Amplitude Settings → Billing. If you only need to send events to Amplitude (for retention analysis, funnels, and cohorts in Amplitude's own UI), the free plan works fully.

---

Source: https://www.rapidevelopers.com/bubble-integrations/amplitude
© RapidDev — https://www.rapidevelopers.com/bubble-integrations/amplitude
