Returning Customer % Rate [Shopify]

Follow the Metric Recipe below to create the metric:

1. Create the dataset

Navigate to the Datasets page and create a new Dataset for the selected source.

a) Create the Dataset

Data Source

Views

Columns

Shopify

Customers

CreatedAt

NumberOfOrders


b) Create a new calculated column in the dataset

  1. Edit the Dataset.

  2. Click the "+" column on the right side to add a new calculated metric.

  3. Into the function field, type in $NumberOfOrders to copy the whole column.

  4. Click Run to update the table.

  5. Rename the new calculated column into "New or Returning".

  6. Apply a formula to this column:

    1. CASE WHEN $NumberOfOrders > 1 THEN 1 ELSE 0 END

  7. Save the Dataset.



2. Create the Custom Metric for "Total Customers"

  1. Navigate to Metric Builder and create a new Custom Metric by selecting the Dataset you previously created.

  2. Fill out the Measure, Date, Dimension, Aggregation, and Filter fields as shown in the diagram below.

  3. Name your metric and save it.

Measure

NumberOfOrders

Date

CreatedAt

Dimension

/

Aggregation

COUNT

Filters

/

3. Create the Custom Metric for "Returning Customers"

  1. Navigate to Metric Builder and create a new Custom Metric by selecting the Dataset you previously created.

  2. Fill out the Measure, Date, Dimension, Aggregation, and Filter fields as shown in the diagram below.

  3. Name your metric and save it.

Measure

NumberOfOrders

Date

CreatedAt

Dimension

/

Aggregation

COUNT

Filters

NumberOfOrders is greater than 1

4. Create a Calculated Metric for "Returning Customer Rate"

  1. Navigate to Data Calculations and create a new Calculated Metric.

  2. Divide Returning Customers with Total Customers.

  3. Set the Format to Percentage.

  4. Name your metric and save it.