# Amplitude

Setup\
Unlike some integrations, Amplitude requires a one-time connection in your Optibase dashboard.<br>

1. Go to your Optibase dashboard → Settings → Integrations
2. Find the Amplitude section and click Connect
3. Select your region — United States (US) or Europe (EU). This must match the region of your Amplitude project.
4. Paste your Amplitude API key. You can find it in Amplitude → Settings → Projects → your project → General.
5. Click Connect. Optibase will verify the key before saving.

This integration is available on paid plans only.\
Testing the Connection\
Once connected, you can verify the integration is working by clicking Test Connection in the Amplitude integration settings. This sends a test event to your Amplitude project. You should see an event named `optibase_connection_test` appear in Amplitude under your project's event stream shortly after.\
Adding Amplitude to Your Page\
You need to include the Amplitude browser SDK on your page before the Optibase script:

```
<script src=""></script>
<script>
  window.amplitude.init('YOUR_AMPLITUDE_API_KEY', {
    defaultTracking: true,
    serverUrl: '', // use  for US
  })
</script>

<!-- Optibase script must come after -->
```

Replace `YOUR_AMPLITUDE_API_KEY` with your Amplitude project API key and set the `serverUrl` to match your region.\
Event Details\
When a variant is assigned to a visitor, Optibase sends an event named `optibase_variant_assigned` to Amplitude containing the following properties:<br>

* `testId` — the ID of the A/B test
* `variantId` — the variant assigned to this visitor

Analytics Setup\
In Amplitude, go to Analytics → Event Segmentation:\
Select the `optibase_variant_assigned` event\
Add a Group By on `testId` to filter to a specific test<br>

1. Add a second Group By on `variantId` to compare variants side by side

To measure conversion, use Funnel Analysis:\
Add Step 1: `optibase_variant_assigned`\
Add Step 2: your conversion event (e.g. a button click or signup)<br>

1. Group by `variantId` to see which variant converts better


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.optibase.io/integrations/amplitude.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
