Below is a step-by-step guide on how to create custom metrics and dimensions using Windsor.ai’s new custom fields feature. With this functionality, you can define metrics like CPA (Cost Per Acquisition) or ROAS (Return On Ad Spend) by combining and transforming existing fields from your data sources. If you’re familiar with spreadsheets or tools like Looker Studio, this will feel right at home.
What Are Custom Fields?
Custom fields let you create your own metrics and dimensions using formulas. You can think of it like creating a calculated field in Google Sheets or Looker Studio or a measure in Power BI. For example, if you have a “cost” field and a “conversions” field from your ad platform, you can easily define a new metric called “CPA” by dividing cost by conversions.
How to Create a Custom Field
- Navigate to the Custom Fields Section Go to onboard.windsor.ai and head to the data preview.
- Choose the Connector Select the data source you’re working with. For example, if you’re pulling data from Facebook Ads, pick “facebook”.
- Click on the plus button below the available fields
- Enter a name for your new metric or dimension and define Your Formula
In the formula box, use the fields and functions to define your new metric.
Sample:sum(float(spend))/sum(float(unique_clicks))
- Basic Syntax:
- Refer to fields directly by their name. If you are unsure about the field ID you can findit by clicking ▼ next to the connector URL in the data preview.
Alternatively you can also click on the ? button next to the fields in the field search. - Use operators like
+
,-
,*
,/
for arithmetic. - Apply built-in functions such as
sum()
,to_float()
, orreplace()
if needed.
- Refer to fields directly by their name. If you are unsure about the field ID you can findit by clicking ▼ next to the connector URL in the data preview.
- Example: To calculate CPA (Cost Per Acquisition), you might have a
cost
field and aconversions
field. Ifcost
andconversions
are your fields, your formula would be:float(spend) / float(actions_purchase)
Make sure to check the field names from the data fields reference page. They might be named slightly differently depending on the connector (e.g., “spend” or “ad_cost” instead of “cost”).
- Another Example (ROAS):
ROAS (Return On Ad Spend) is typically calculated as the revenue generated divided by the cost. If your revenue field is calledrevenue
and your cost field iscost
, your formula would be:float(action_values_purchase) / float(spend)
- Basic Syntax:
- Save Your Custom Field Once you’re happy with the formula, click on save. The custom field will now be available just like any other metric or dimension in Windsor.ai. If you want to modify your formula you can click on the pencil button next to it. To delete, use the trash can button.
Video Walkthrough
Example 1:
The formula for the campaign grouping field is
if(
'Japan' in campaign or 'APAC' in campaign, 'APAC',
if('UK' in campaign or 'FR' in campaign, 'EUROPE', 'other')
)
Example 2:
The formula for the clicks2 field is:
float(link_clicks)
Facebook Ads
The formula for the clicks2 field is:
float(clicks)
Google Ads