A dataset contains information about leads, deals, companies, and other Bitrix24 items. Each item has several datasets that automatically receive data from system and custom fields. Use datasets to create charts and analyze business metrics.
In this article, you'll learn about datasets for Sales Intelligence, how to merge them, and how to create charts.
Datasets:
Examples:
Choose a dataset
To analyze information in a dashboard, choose a suitable dataset and create a chart.
tracking_source — ad sources. This dataset contains data about ad sources. Use this dataset to add the ad source name to a report.
tracking_source
| Field | Description | Data type |
|---|---|---|
| ID | Ad source ID | Number |
| NAME | Ad source name | String |
| UTM_SOURCE_LIST | utm_source parameters in JSON format | String |
tracking_source_expenses — ad costs. This dataset contains data about ad costs. Use this dataset to analyze costs and ad campaign performance.
tracking_source_expenses
| Field | Description | Data type |
|---|---|---|
| SOURCE_ID | Ad source ID | Number |
| EXPENSES | Ad costs for the day | Decimal number |
| CURRENCY | Cost currency | String |
| DATE | Cost date | Date |
| CAMPAIGN_NAME | Ad campaign name | String |
| CAMPAIGN_ID | Ad campaign ID | String |
| GROUP_NAME | Ad group name | String |
| GROUP_ID | Ad group ID | String |
| AD_NAME | Ad name | String |
| AD_ID | Ad ID | String |
| CLICKS | Number of clicks | Number |
| IMPRESSIONS | Number of impressions | Number |
| ACTIONS | Number of actions | Number |
| CPM | Cost per thousand impressions | Decimal number |
| CPC | Cost per click | Decimal number |
| UTM_MEDIUM | Traffic type ID | String |
| UTM_SOURCE | Traffic source ID | String |
| UTM_CAMPAIGN | Ad campaign ID | String |
| UTM_CONTENT | Content item ID | String |
Create a chart
Add information from a dataset to charts. Compare costs with clicks and impressions to evaluate sources and campaigns. Add the source name to cost data to see which ads use the budget.
- Open BI Builder > Charts.
- Click + Chart in the top-right corner.
- Choose a dataset from the list. If you do not see the dataset you need, click Add a dataset.
Create a dataset - Choose a chart type — the format for viewing the information, such as a card, table, line chart, or another option.
- Click Create new chart.
Merge datasets
Merge datasets to add the ad source name to cost data.
- Open BI Builder > SQL > SQL Lab.
- Make sure
bitrix24is selected in the Schema field. - Enter the SQL query and click Run.
- Review the query results. To create a chart for a report, save the query as a dataset. The dataset receives data from the fields specified in the SQL query.
Create a chart from a virtual dataset
If this is your first time merging datasets, see the sample query.
Example SQL query
This SQL query merges ad sources (tracking_source) and ad costs (tracking_source_expenses). You can copy it to see how the query works. The result shows the date, source name, campaign name, and costs.
SELECT tracking_source_expenses.DATE AS "Date", tracking_source.NAME AS "Ad source", tracking_source_expenses.CAMPAIGN_NAME AS "Ad campaign", tracking_source_expenses.EXPENSES AS "Costs", tracking_source_expenses.CURRENCY AS "Currency" FROM tracking_source_expenses LEFT JOIN tracking_source ON tracking_source.ID = tracking_source_expenses.SOURCE_ID
SELECT determines which information to extract from the dataset. For example, SELECT tracking_source.NAME AS "Ad source":
- Selects the source name
NAMEfrom thetracking_sourcedataset - Names it
Ad source - Shows the result as a separate column in the table
FROM specifies the main dataset the data comes from. Here it is tracking_source_expenses, the table with ad cost data.
LEFT JOIN connects the tracking_source_expenses table with tracking_source. The query adds the source name and keeps cost rows even if no matching source is found.
ON links the datasets by source ID: tracking_source.ID and tracking_source_expenses.SOURCE_ID.
In brief
- A dataset contains information about leads, deals, companies, and other Bitrix24 items.
- Each item has several datasets that automatically receive data from system and custom fields.
- Datasets for Sales Intelligence: ad sources (tracking_source) and ad costs (tracking_source_expenses).
- Use datasets to create charts and analyze ad performance. Charts show costs and clicks by source and campaign.
- Merge datasets to add the ad source name to cost data. Write an SQL query, save the result as a dataset, and create a chart.