Custom conversions are available only on the enterprise plan.
- They are created and maintained by the SegmentStream technical team.
- Any data in your BigQuery can be used to calculate conversions.
Using CRM data
SegmentStream supports data sources for the following CRM tools, allowing you to load data directly into the connected Google BigQuery dataset:- HubSpot
- Salesforce
- Microsoft Dynamics
- Pipedrive
Creating a custom conversion
The SQL query results should consist of three columns:id, client_id, and created. Additional columns are optional based on available data.
- The
createdcolumn must always contain a valid timestamp. - For optional columns, assign
NULLonly if data is occasionally unavailable. If all values for a column are unknown, omit that column from the query. - If your query involves a partitioned table (for example, partitioned by
date), include a filter on the partition column in theWHEREclause:
| SQL field name | Type | Description | Required |
|---|---|---|---|
id | STRING | ID of conversion/order used for deduplication | Yes |
client_id | STRING | Google Analytics client ID. If not provided, the conversion will be marked as (not attributed) in reports. | Yes |
created | TIMESTAMP | Date and time of the conversion | Yes |
value | FLOAT64 | The monetary value of the conversion | No |
currency | STRING | 3-letter ISO 4217 currency code (USD, EUR, GBP). If NULL, project currency is used. | No |
is_qualified | BOOLEAN | True if conversion reached target status | No |
params | ARRAY<STRUCT<key STRING, value STRING>> | Array of custom parameters passed with each conversion | No |
user_id | STRING | User’s ID from the CRM | No |
Collecting geo data from CRM
To improve your market selection options for launching geo tests, consider collecting geo location data in your CRM. When adding geo data from your CRM, include it in theparams column as key-value pairs. The key should indicate the geographical scope (city, country, or region), while the value should specify the name of the geo location.
Example
After a user purchases a service on your website, they need to confirm their order when contacted by your call centre staff. Once a call centre operator receives confirmation, they update the status in the CRM system. To view users who have confirmed their purchase in SegmentStream reports, load the data from the CRM system into BigQuery. Then create a custom conversion with SQL that extracts conversions from the CRM data, along with a client identifier used to stitch the conversion to the user’s website session. The following code runs a daily check on website orders created within the last 30 days. It marks them as conversions if their CRM statuses are “confirmed” or “paid”, and collects the country, region, and city information.
Predicted value
You can use a predicted value for your custom conversions. This value is calculated by linking a target conversion’s value to the probability of that conversion occurring. To activate this feature, theuser_id fields in both the target custom conversion and in any custom conversion for which you want a predicted value should be based on the same identifier. Also, the CRM data that the custom conversion is built on should contain user-related data — such as geolocation, activities, and any other information particular to that user. This data serves as features for the machine learning model that predicts the value.
When you validate the SQL for your custom conversion, you will find an option called “Predicted value.” Choosing this reveals two more fields:
- Target conversion — shows all eligible conversions for value prediction. To qualify, a custom conversion needs the
user_idfield and at least one conversion in the past 60 days. - Conversion window — sets the maximum timeframe for linking conversions.
Use case
Consider this scenario: you track two types of conversions. The first is called “Lead,” which occurs when someone submits a form. The second, “Deal Closed,” happens when a lead converts into a deal. Each deal has a unique value. To estimate the value of each lead, create a modified “Lead” conversion. Enhance the SQL by incorporating CRM data features such as the number of times the user has contacted sales, their business country, and their job title. Set the conversion value to “Predicted value,” choose “Deal Closed” as the target conversion, and set the conversion window to 40 days to accommodate the typical duration within which most leads convert into deals. After SegmentStream completes its calculations, you can view the predicted value of each lead based on the value of the deals that have closed.
Conversions adjustment
Enabling conversions adjustment allows you to specify a time window, in days, during which conversion data in SegmentStream can be updated based on changes detected in your CRM. This keeps SegmentStream data aligned with your CRM records.