Working with Custom Fields

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

  1. Navigate to the Custom Fields Section Go to onboard.windsor.ai and head to the data preview.
  2. Choose the Connector Select the data source you’re working with. For example, if you’re pulling data from Facebook Ads, pick “facebook”.
  3. Click on the plus button below the available fields ""
  4. 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(), or replace() if needed.

       

    • Example: To calculate CPA (Cost Per Acquisition), you might have a cost field and a conversions field. If cost and conversions 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 called revenue and your cost field is cost, your formula would be:

      float(action_values_purchase) / float(spend)

       

  5. 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

Common Formula Examples

Below are a few common marketing metrics you might want to create as custom fields:

  1. CPA (Cost Per Acquisition):
    Formula: float(totalcost) / float(conversions)
    This divides your total cost by the number of conversions, telling you how much each acquisition costs on average.
  2. ROAS (Return On Ad Spend):
    Formula: float(transactionrevenue) / float(totalcost)
    This shows how much revenue you earn for each unit of currency you spend on ads.
  3. CTR (Click-Through Rate):
    Formula: (float(clicks) / float(impressions)) * 100
    This converts your click-to-impression ratio into a percentage.
  4. CPC (Cost Per Click):
    Formula: float(totalcost) / float(clicks)
    This lets you see how much each click costs on average.

Tips and Tricks

  • Check Field Names:
    Always verify the exact field names from the data fields reference pages. Small differences in field names can cause the formula to fail.
    Link: Data Fields Reference Pages
  • Validate With a Simple Test:
    Start by creating a simple formula and make sure it produces a reasonable value. For example, check your CPA calculation for a given day against your known metrics.
  • Blending Data from Different Sources:
    If you want to e.g. calculate ROI from Facebook Ads spend and Shopify revenues you can use the all connector and use this Formula: float(spend)/float(order_net_sales).

Conclusion

Creating custom metrics and dimensions with Windsor.ai is straightforward and flexible. By combining existing fields and using familiar spreadsheet-like formulas, you can tailor your analytics to your exact needs. Give it a try with CPA, ROAS, or any other custom metric you’ve been wanting to track!