Integrate Convert Experiences with Databricks
Send Convert Experiment Data to Databricks and Use Databricks Audiences for Targeting
| Author: | Dionysia Kontotasiou |
IN THIS ARTICLE YOU WILL:
Connect your Convert experimentation data with Databricks to analyze experiment performance alongside your business data and use Databricks customer audiences to deliver more targeted experiences.
Overview
Databricks is a data intelligence platform that helps organizations process, manage, and analyze large volumes of data.
By connecting Convert Experiences with Databricks, you can bring experimentation data into your existing analytics environment and use customer segments from Databricks to create more relevant experiences.
There are two ways to integrate these platforms:
| Integration | What you can do |
|---|---|
| Convert → Databricks | Send experience activations, variation assignments, and conversion events to Databricks for advanced analytics |
| Databricks → Convert | Use Databricks customer segments to target A/B tests and personalized experiences in Convert |
Requirements:
- An active Convert Experiences project
- A Databricks workspace
- Access to your website's JavaScript or backend
- A backend event collection endpoint for sending data to Databricks
📒 Note:
This guide describes a custom integration using supported platform capabilities. It does not describe a native, one-click Databricks connector.
Part 1: Send Convert Experience and Variation Events to Databricks
Why Send Convert Data to Databricks?
Convert provides built-in experiment reporting. However, you may want to analyze your experiment results alongside additional business data stored in Databricks.
For example, you can use Databricks to investigate:
- How experiment variations affect revenue and customer lifetime value
- Whether an experiment improves long-term customer retention
- How experiment performance differs between customer segments
- The impact of an experiment on subscriptions, renewals, or cancellations
- How experiment results relate to other customer behavior
To perform these analyses, you can forward Convert experience and conversion events to Databricks.
How It Works
The integration follows this process:
Convert Experiences → JavaScript Lifecycle Events → Your Event Collection Endpoint → Databricks → Analytics
When a visitor is exposed to an experience, Convert can trigger a JavaScript lifecycle event.
Your integration captures the event information and sends it to your own backend endpoint, which forwards the data to Databricks.
Step 1: Choose the Convert Events You Want to Send
Convert provides JavaScript lifecycle events that can be used to capture different stages of an experience.
| Convert event | Description |
|---|---|
| experience.variation_decided | A variation has been selected for execution |
| experience.activated | An experience has been activated and its changes executed |
| goal.triggered | A conversion goal has been triggered |
For most experiment exposure integrations, we recommend using experience.activated.
This allows you to capture the experience and variation information after activation.
You can also listen for goal.triggered to forward conversion events.
Important:
Variation assignment and exposure are different events. Use the event that best represents the measurement you want to analyze.
Step 2: Capture Experience and Variation Events
Add the following JavaScript to your website before the Convert tracking script initializes, or use a supported Convert project-level JavaScript configuration that registers the listener before the relevant activation occurs.
window._conv_q = window._conv_q || [];
window._conv_q.push({
what: "addListener",
params: {
event: "experience.activated",
handler: function(event) {
var data = event.data || {};
var payload = {
event_id: crypto.randomUUID(),
event_name: "convert_experience_exposure",
timestamp: new Date().toISOString(),
experience_id: data.experience_id,
variation_id: data.variation_id,
activated_first_time:
data.activated_first_time,
page_url: window.location.pathname
};
fetch("/api/convert-events", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(payload),
keepalive: true
}).catch(function(error) {
console.error(
"Convert event delivery failed:",
error
);
});
}
}
});
Replace /api/convert-events with the URL of your event collection endpoint.
The code listens for experience activations and sends the captured information to your backend.
Example event payload:
{
"event_id": "evt_123456",
"event_name": "convert_experience_exposure",
"timestamp": "2026-10-15T10:00:00Z",
"experience_id": "12345",
"variation_id": "67890",
"activated_first_time": true,
"page_url": "/checkout"
}
The event contains the experience and variation identifiers needed for downstream analysis.
For visitor-level analytics, extend the payload with a stable pseudonymous identifier obtained through an appropriate, consent-aware identification method.
Note: The example illustrates the integration pattern. Verify the lifecycle event fields, browser support, listener timing, and endpoint configuration in your environment before deployment.
Step 3: Capture Convert Conversion Events
You can also forward conversion events using the goal.triggered lifecycle event.
window._conv_q = window._conv_q || [];
window._conv_q.push({
what: "addListener",
params: {
event: "goal.triggered",
handler: function(event) {
var data = event.data || {};
var payload = {
event_id: crypto.randomUUID(),
event_name: "convert_goal_triggered",
timestamp: new Date().toISOString(),
convert_event_data: data
};
fetch("/api/convert-events", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(payload),
keepalive: true
}).catch(console.error);
}
}
});
This example forwards the goal event data to your backend.
Your backend should validate the received payload and retain only the fields required for analytics.
Avoid forwarding unnecessary personal information or sensitive properties.
Step 4: Send Events to Databricks
Once your backend receives Convert events, you can ingest them into Databricks.
Two approaches are available.
Option A: Databricks SQL Statement Execution API
For proof-of-concept or lower-volume integrations, use the Databricks SQL Statement Execution API.
Endpoint:
POST https://<workspace-host>/api/2.0/sql/statements
You can create a destination table using Databricks SQL:
CREATE TABLE IF NOT EXISTS
main.analytics.convert_events (
event_id STRING,
event_name STRING,
event_timestamp TIMESTAMP,
experience_id STRING,
variation_id STRING,
visitor_id STRING
)
USING DELTA;
Your backend can then submit parameterized SQL statements to insert events into this table.
You will need the Databricks workspace URL, appropriate authentication credentials, a SQL warehouse ID, and permissions to write to the table.
Use server-side authentication and verify the SQL statement execution status.
Option B: Databricks Auto Loader
For larger event volumes, we recommend using an ingestion pipeline based on cloud storage.
- Collect Convert events through your backend.
- Validate and batch the events.
- Store them in Amazon S3, Azure Data Lake Storage, or Google Cloud Storage.
- Configure Databricks Auto Loader to ingest the files.
- Store the processed data in Delta tables.
This approach is better suited to scalable event ingestion.
For details, see Databricks Auto Loader.
Step 5: Analyze Experiment Data in Databricks
Once events are available in Databricks, you can analyze them using SQL.
For example, the following query counts recorded experience activations by variation:
SELECT
experience_id,
variation_id,
COUNT(*) AS activation_events
FROM main.analytics.convert_events
WHERE event_name =
'convert_experience_exposure'
GROUP BY
experience_id,
variation_id
ORDER BY activation_events DESC;
You can also join experiment data with customer, transaction, and subscription tables.
This enables custom analysis of revenue, retention, and other business outcomes.
⚠️ Important:
Activation event counts are not necessarily unique visitor counts. For reliable experiment analysis, implement visitor identification, event deduplication, and appropriate attribution rules.
Part 2: Use Databricks Audiences to Target Convert Experiences
Why Use Databricks Audiences?
Databricks can help you create customer segments using information from your CRM, transaction history, customer behavior, and predictive models.
You can then use those segments to target experiments in Convert.
For example, you might want to:
- Show premium offers to high-value customers
- Test retention messages among customers at risk of churn
- Personalize experiences for returning customers
- Test onboarding flows for new customers
- Deliver targeted experiences based on purchase history
Instead of recreating your segmentation logic in Convert, you can make Databricks-derived audience attributes available to Convert's targeting system.
How It Works
The integration follows this process:
Databricks → Audience Lookup or Synchronization → Website dataLayer → Convert Audience Targeting → Experience
Databricks calculates the audience membership.
Your backend retrieves the relevant segment for the current visitor.
Your website then exposes that segment to Convert using a JavaScript variable or dataLayer.
Convert evaluates the attribute to determine whether the visitor qualifies for the experience.
Step 1: Create an Audience in Databricks
For example, you could create a segment of high-value customers who have spent more than €500 and placed at least three orders in the last 90 days.
SELECT
customer_id,
'high_value' AS audience_segment
FROM customer_orders
WHERE order_date >=
current_date() - INTERVAL 90 DAYS
GROUP BY customer_id
HAVING SUM(order_total) > 500
AND COUNT(DISTINCT order_id) >= 3;
The query returns customers who meet your audience criteria.
You can define additional segments based on your business requirements.
Step 2: Make the Audience Available to Your Website
Your website needs a way to retrieve the current visitor's audience membership.
You can use either:
Scheduled synchronization
Periodically export Databricks audience membership to a database or cache used by your website.
This is suitable for segments updated daily or hourly.
Backend audience lookup
Retrieve the visitor's audience membership through a backend service when needed.
This is useful when more current audience information is required.
We recommend resolving audience membership on your backend rather than querying Databricks directly from browser JavaScript.
Step 3: Pass Audience Attributes to Convert
Once your application has identified the visitor's audience, expose the information through the website's dataLayer.
For example:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
databricks_segment: "high_value",
loyalty_tier: "gold"
});
The example assumes that your backend has already determined the visitor's audience membership.
In a production implementation, these values should be populated dynamically.
Step 4: Configure Audience Targeting in Convert
In Convert Experiences:
- Open the experience you want to target.
- Navigate to the audience configuration.
- Add or create an Advanced Audience.
- Select a JavaScript Condition.
- Enter the condition that identifies the Databricks audience.
For example:
window.dataLayer?.some(
item =>
item.databricks_segment === "high_value"
) === true
This condition evaluates to true when the current visitor belongs to the high_value audience.
Save the audience and associate it with your experience.
Convert can then use the condition to determine whether the visitor qualifies for the experience.
You can combine this condition with additional targeting rules, including page URL, device, or other visitor attributes.
Step 5: Handle Asynchronous Audience Loading
In some implementations, audience information may not be available immediately when the page loads.
For example, your website may need to authenticate the visitor and retrieve their segment from a backend service.
If Convert evaluates targeting before the audience data becomes available, the visitor may not qualify for the experience.
To avoid this, make audience information available before targeting is evaluated whenever possible.
For asynchronous implementations, consider Convert's supported Dynamic Location Triggers and callbacks.
Step 6: Test Audience Targeting
Before publishing your experience, verify the following scenarios:
| Scenario | Expected behavior |
|---|---|
| Visitor belongs to the Databricks audience | Visitor qualifies for the experience |
| Visitor does not belong to the audience | Visitor is excluded |
| Audience data is unavailable | Configured fallback behavior applies |
| Audience data arrives asynchronously | Targeting is evaluated at the correct time |
| Audience membership changes | Experience follows the configured audience and assignment behavior |
Also verify that the selected Convert audience type matches your intended targeting behavior.
Integrating Convert Experiences with Databricks enables two complementary workflows.
Convert → Databricks: Send experience, variation, and conversion events into your analytics environment to analyze experimentation outcomes alongside your business data.
Databricks → Convert: Use customer audiences and segments created in Databricks to deliver more targeted experiments and personalized experiences.
Together, these workflows help connect experimentation with customer intelligence and business analytics while allowing your organization to maintain control over its data infrastructure.