Import from Metabase
Connect Metabase to Digia Engage and import a saved question or model as an audience, with optional columns as properties.
This guide connects Metabase to Digia Engage and imports a saved question or model as an audience. Each row the question returns is one person. Digia runs the question every hour, so the audience follows your data without any exports.
Use this when your audience lives in your database or warehouse: write the query once in Metabase, and Digia keeps it in sync.
By the end, you should have:
- Metabase connected under Data → Connectors
- a saved question imported as an audience, matched to your app users by one of its columns
- optionally, other columns such as
planavailable in campaign text
Before you start
Make sure you have:
- Audiences enabled for your Digia Engage project (see Before you start).
- A Metabase that is reachable over
https://from the internet, such as Metabase Cloud. - Admin access in Metabase, to create an API key.
- A saved question or model that returns one row per person, with a column holding the same
user ID your app passes to
setUserId. - To import properties: user verification turned on.
Keep the question focused: one row per user, the ID column, and only the columns you want as properties. Digia reads every row each hour, so a question that takes a long time to run may time out.
Step 1: Create a Metabase API key
- In Metabase, go to Admin → Settings → Authentication → API keys.
- Create a key and put it in a group that can view the collection holding your question.
- Copy the key. It starts with
mb_and is shown only once.
Metabase: creating an API key and choosing its group. Until then, see Metabase's guide to API keys.
Step 2: Connect Metabase in Digia
- Open Data → Connectors.
- On the Metabase card, click + Connect.
- Enter your Metabase URL, for example
https://yourcompany.metabaseapp.com. - Paste the API key.
- Click Connect.

Digia checks the details against Metabase before it saves them. When they work, you see Metabase connected. Import a question now, or come back to it later., and the question list opens.
Step 3: Choose a question
Pick the saved question or model to import and click Continue. The list shows every question and model the API key's group can view. A question that is already imported shows Already imported.
Digia: the Choose a question step listing Metabase saved questions and models.
Seeing No saved questions or models are visible to this API key? Save the question in Metabase, or give the key's group view access to its collection.
Step 4: Choose the user ID column and properties
- Under User id column, choose the column that holds the same value your app passes to
setUserId. Rows without a value are left out and counted. - Optional: pick other columns to import as properties, and name each one. The name is what you
type in campaign text, for example
{{plan}}. - Click Import "{question}".
Digia: the Import properties step with User id column and the property picker.
Step 5: Check the audience
Open Data → Audiences. After the first sync, the audience shows its size and how many of its people match an app user.
Digia runs the question every 60 minutes. To sync right away, click Sync now on the row.
Now use the audience in a campaign.
Troubleshooting
| Message | What to do |
|---|---|
| The Metabase URL must start with https:// | Use the https:// address of your Metabase. |
| Metabase rejected the API key | The key is wrong or revoked. Create a new one under Admin → Settings → Authentication → API keys. |
| The API key's group cannot view Metabase question {id} | Give the key's group view access to the collection that holds the question. |
| Metabase question {id} was not found | The question was deleted. Delete the audience in Digia, or import another question. |
| Metabase question {id} took too long to run | Add filters or simplify the question, then click Sync now. |
| Column "{x}" not found in the question's columns | The ID column was renamed or removed from the question. Restore it, or import the question again. |
| Metabase rate limit reached | Click Sync now in a few minutes. |
| Could not reach Metabase with those details | Check the URL is reachable from the internet. |